• Resolved ads1018

    (@ads1018)


    Is there any way to set custom thumbnail sizes for specific posts? I want the post thumbnails for my sticky posts to be 500 x 500 but the default to be. Can’t find any information on this matter on the web.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try adding the following to functions.php:

    // Set up custom post image sizes
    if ( function_exists( 'add_image_size' ) ) {
    	add_image_size( 'sticky-post-thumbnail', 500, 500 );
    }

    Then in index.php, use something like:

    <?php if( has_post_thumbnail() ) {
    	if( is_sticky() ) the_post_thumbnail( 'sticky-post-thumbnail' );
    	else the_post_thumbnail();
    }
    ?>
    Thread Starter ads1018

    (@ads1018)

    YES! bravo. Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post Thumbnail Size’ is closed to new replies.