• Resolved matt-tyas

    (@matt-tyas)


    Hi,

    I am trying to check if ‘big-post-thumb’ exists (a new image size) display it, if not display ‘cat-post-thumb’. I have regenerated my thumbnails to use this new size but there are so many some are always missed so this is to catch them and display the old image size instead.

    <?php
    	if ( has_post_thumbnail( 'big-post-thumb' ) ) {
    	     echo ''. the_post_thumbnail( 'big-post-thumb' ) .'';
    	 }
    	else {
    		echo ''. the_post_thumbnail( 'cat-post-thumb' ) .'';
    	}
    ?>

    Can you not do has_post_thumbnail( ‘custom-image-size’) ??

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘if statement to display custom image sizes’ is closed to new replies.