0

I had created custom post type called "Case Studies" for my Website.

Now whenever I am trying share any Post from Case Studies in LinkedIn it showing me preview as small thumb image along with Title in side by side but when I share Blog Post or Page in LinkedIn it shows me full width Image and Title in Below so I can add support to show Image as full width preview for all social media platforms.

Here is my Case Study code in functions.php

/* Case Studies Section */
add_action( 'init', 'cptui_register_my_cpts_case_studies' );
function cptui_register_my_cpts_case_studies() {
    $labels = array(
        "name" => "Case Studies",
        "singular_name" => "Case Study",
        );

    $args = array(
        "labels" => $labels,
        "description" => "Create Case Studies Here",
        "public" => true,
        "show_ui" => true,
        "show_in_rest" => false,
        "has_archive" => false,
        "show_in_menu" => true,
        "exclude_from_search" => false,
        "capability_type" => "post",
        "map_meta_cap" => true,
        "hierarchical" => false,
        "rewrite" => false,
        "query_var" => true,
        "menu_position" => 5,       
        "supports" => array( "title", "editor", "excerpt", "custom-fields", "thumbnail" ),      
        "taxonomies" => array( "division", "cstags" ),      
    );
    register_post_type( "case_studies", $args );
}

add_action( 'init', 'cptui_register_my_taxes_division' );
function cptui_register_my_taxes_division() {

    $labels = array(
        "name" => "Division",
        "label" => "Division",
        );

    $args = array(
        "labels" => $labels,
        "hierarchical" => true,
        "label" => "Division",
        "show_ui" => true,
        "query_var" => true,
        "rewrite" => array( 'slug' => 'case-studies', 'with_front' => true ),
        "show_admin_column" => false,
    );
    register_taxonomy( "division", array( "case_studies" ), $args );
}


add_action( 'init', 'cptui_register_my_taxes_cstags' );
function cptui_register_my_taxes_cstags() {

    $labels = array(
        "name" => "CSTags",
        "label" => "CSTags",
        );

    $args = array(
        "labels" => $labels,
        "hierarchical" => true,
        "public" => true,
        "publicly_queryable" => true,
        "label" => "CSTags",
        "show_ui" => true,
        "query_var" => true,
        "hierarchical" => false,
        'rewrite'   => array('slug' => '', 'with_front' => false ),
        "show_admin_column" => false,
    );
    register_taxonomy( "cstags", array( "case_studies" ), $args );
}

I had allready added add_theme_support('post-thumbnails'); in my functions.php for theme support so why Case Study - Custom Post type is not showing full width preview and page/blog posts are showing.

for reference you can check following URLs.

Blog Post : https://www.hitechdigital.com/dev/blog/how-digital-quantity-take-offs-and-cost-estimation-benefit-millwork-developers-beta/

Case Study : https://www.hitechdigital.com/dev/blog/how-digital-quantity-take-offs-and-cost-estimation-benefit-millwork-developers-beta/

Any help is most appreciated.

Thank you.

1 Answer 1

0

This happens when the image does not have a specific width/height. The image you try to load in your custom-post-type is too small (379x354px). So LinkedIn, Facebook or others will use the layout with the smaller image.

Facebook says: Images that are at least 470×246 pixels will display as a rectangle with the title and description below. Images that are smaller than 470×246 pixels will display as a square with the title and description to the right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.