Title: [Plugin: Video Thumbnails] Conditional thumbnail on index.php and single.php
Last modified: August 20, 2016

---

# [Plugin: Video Thumbnails] Conditional thumbnail on index.php and single.php

 *  Resolved [Joseph](https://wordpress.org/support/users/joseph94/)
 * (@joseph94)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/)
 * Currently using this plugin, and it works great.
 * Would it be possible to display a thumbnail on the index.php page, but not on
   the single.php page, depending on if it’s a thumbnail from the video?
 * [http://wordpress.org/extend/plugins/video-thumbnails/](http://wordpress.org/extend/plugins/video-thumbnails/)

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

 *  Plugin Author [Sutherland Boswell](https://wordpress.org/support/users/sutherlandboswell/)
 * (@sutherlandboswell)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/#post-2843796)
 * Yep, just use
 * `<?php if( ( $video_thumbnail = get_video_thumbnail() ) != null && !is_single()){
   echo "<img src='" . $video_thumbnail . "' />"; } ?>`
 *  Thread Starter [Joseph](https://wordpress.org/support/users/joseph94/)
 * (@joseph94)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/#post-2843835)
 * 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](https://wordpress.org/support/users/sutherlandboswell/)
 * (@sutherlandboswell)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/#post-2843841)
 * 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](https://wordpress.org/support/users/joseph94/)
 * (@joseph94)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/#post-2843846)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/video-thumbnails_3e6f7f.svg)
 * [Video Thumbnails](https://wordpress.org/plugins/video-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/video-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-thumbnails/reviews/)

## Tags

 * [index.php](https://wordpress.org/support/topic-tag/index-php/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)
 * [video thumbnail](https://wordpress.org/support/topic-tag/video-thumbnail/)

 * 4 replies
 * 2 participants
 * Last reply from: [Joseph](https://wordpress.org/support/users/joseph94/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-video-thumbnails-conditional-thumbnail-on-indexphp-and-singlephp/#post-2843846)
 * Status: resolved