Title: thumbnail code clashes with template code
Last modified: August 20, 2016

---

# thumbnail code clashes with template code

 *  epspk
 * (@epspk)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/thumbnail-code-clashes-with-template-code/)
 * I think this automatic youtube posts plugin is really cool!
    Unfortunately, the
   free theme I am using doesn’t provide support and the thumbnails don’t show up
   at all. So after reading the docs on this plugin and some forum posts I have 
   to use this code: `<?php tern_wp_youtube_image(); ?>` And I was able to find 
   the exact file to insert it to and even the exact line. But I when I insert the
   code to this line from my theme: `<div class="thumbnail"><?php the_post_thumbnail(
   array(300, 800)); ?></div>` before the closing div, there is still a broken image
   space being displayed. I can remove it by replacing the `<?php the_post_thumbnail(
   array(300, 800)); ?>` code with `<?php tern_wp_youtube_image(); ?>` but other
   category pages not related to my youtube posts, wont display their own thumbnails.
 * I have low knowledge in php script and I wondering if anyone can guide me on 
   what to do with this? Is there a code that can replace the theme’s code line 
   with the plugin’s code line mentioned above, just for a particular category, 
   tag or post?
 * Thanks!
 * [http://wordpress.org/extend/plugins/automatic-youtube-video-posts/](http://wordpress.org/extend/plugins/automatic-youtube-video-posts/)

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

 *  Plugin Author [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * (@mpraetzel)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/thumbnail-code-clashes-with-template-code/#post-3224779)
 * I would try an if statement which asks if there is a video assigned first. Something
   like:
 * <?php if(get_post_meta($post->ID,’_tern_wp_youtube_video’,true)) { tern_wp_youtube_image();}?
   >
 *  [ExtremeNature](https://wordpress.org/support/users/extremenature/)
 * (@extremenature)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/thumbnail-code-clashes-with-template-code/#post-3224780)
 * Thank you for very nice Plugin.
 * I use this code for thumb in archive.php of my template for gnerate image in 
   category list :
    <?php if(get_post_meta($post->ID,’_tern_wp_youtube_video’,true)){
   tern_wp_youtube_image(); } ?>
 * I can’t define the image size at : 135×90 px
 * Can you help me ?
 * Thanks
 *  Plugin Author [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * (@mpraetzel)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/thumbnail-code-clashes-with-template-code/#post-3224782)
 * The plugin now adds the images automatically anywhere your theme uses the_post_thumbnail
   at the size your theme specifies. I’d suggest going that route.

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

The topic ‘thumbnail code clashes with template code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/automatic-youtube-video-posts_e39595.
   svg)
 * [Automatic Youtube Video Posts Plugin](https://wordpress.org/plugins/automatic-youtube-video-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/automatic-youtube-video-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/automatic-youtube-video-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/automatic-youtube-video-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/automatic-youtube-video-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/automatic-youtube-video-posts/reviews/)

## Tags

 * [automatic](https://wordpress.org/support/topic-tag/automatic/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [panoramica](https://wordpress.org/support/topic-tag/panoramica/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)
 * [Youtube](https://wordpress.org/support/topic-tag/youtube/)

 * 3 replies
 * 3 participants
 * Last reply from: [ternstyle](https://wordpress.org/support/users/mpraetzel/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/thumbnail-code-clashes-with-template-code/#post-3224782)
 * Status: not resolved