Specific image size thumbnail for og image

#40023
  • Resolved info combat
    Rank Math free

    Hi there need a little help. How can i share specific image thumbnail that i create to be shared on facebook if its applicable.

    https://xxxxxxx/wp-content/uploads/2020/04/xxxxxxxx-800×470.jpg”>

    /*register image thumb size for og facebook*/

    add_theme_support( ‘post-thumbnails’ );
    add_image_size( ‘facebook-og’, 800, 470, true );

    /*
    add_filter( “rank_math/opengraph/{$network}/image”, function( $attachment_url ) {
    return $attachment_url;
    });*/
    Thank you for your rich feature plugin keep up

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can add your custom image size the array of images that the plugin loops through to find the appropriate image by using the following code:

    /**
     * Determines which image sizes we'll loop through to get an appropriate image.
     *
     * @param unsigned array - The array of image sizes to loop through. Default array( 'full', 'large', 'medium_large' )
     */
    add_filter( 'rank_math/opengraph/image_sizes', function( $sizes ) {
            //uncomment below to pass only your custom image size
            // $sizes = array('facebook-og');
    
            // add you image size to the default thumbnail sizes
            // $sizes = array( 'full', 'large', 'medium_large','facebook-og' );
    	return $sizes;
    });

    You can comment either the first $image or second variable to use one.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Awsome thank you for the fast reply! Its one of the best plugins with freemium feaures! Excellent support thank you for your effort and time

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Specific image size thumbnail for og image’ is closed to new replies.