Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Yep, just use

    <?php if( ( $video_thumbnail = get_video_thumbnail() ) != null && !is_single() ) { echo "<img src='" . $video_thumbnail . "' />"; } ?>

    Thread Starter Joseph

    (@joseph94)

    Hmm. Didn’t seem to do what I want. The video thumbnail still displays fine on my homepage, but still displays on the single post page. If it’s a thumbnail specifically from the video, then I don’t want it to show up at all on the single post.

    This is what I have in my single.php file:

    <div id="single-thumb">
    
    <?php if( ( $video_thumbnail = get_video_thumbnail() ) != null && !is_single() ) {
    	echo "<img src='" . $video_thumbnail . "' />"; } ?>
    
    	<?php if ( has_post_thumbnail() ) {
    				the_post_thumbnail('post-thumb'); ?>
    			<?php } ?>
    </div>
    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    So the plugin settings have the video thumbnail set as a featured image? If that’s the case you can try this in single.php:

    <?php if( get_video_thumbnail() == null &&  has_post_thumbnail() ) { ?>
    <div id="single-thumb">
    	<?php the_post_thumbnail('post-thumb'); ?>
    </div>
    <?php } ?>
    Thread Starter Joseph

    (@joseph94)

    That did the trick. Thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Video Thumbnails] Conditional thumbnail on index.php and single.php’ is closed to new replies.