Forums

Multiple Post Thumbnails
[resolved] If secondary thumbnail is empty, do not show (4 posts)

  1. kcomphlint
    Member
    Posted 1 year ago #

    I am using the following code to call the "secondary image" into my template:

    <?php if (class_exists('MultiPostThumbnails') && MultiPostThumbnails::has_post_thumbnail('page', 'secondary-image',$post->ID)) :
        MultiPostThumbnails::the_post_thumbnail('page', 'secondary-image', $post->ID, 'fifth-image');
    endif; ?>

    Shouldn't this not try to display the image if it has been removed, as in, there is no secondary image set for a particular page?

    http://wordpress.org/extend/plugins/multiple-post-thumbnails/

  2. kcomphlint
    Member
    Posted 1 year ago #

    nevermind, i figured it out.

  3. umarglobal
    Member
    Posted 1 year ago #

    aaah come on kcomphlint.. you could have posted a solution.. im stuck on this and have no clue what to do.

  4. Chris Scott
    Member
    Plugin Author

    Posted 1 year ago #

    If there is no secondary image set then it should echo a blank string so there would be no output. If anyone is seeing differently, please post details.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic