Title: Validation error on thumbnail shortcode
Last modified: August 30, 2016

---

# Validation error on thumbnail shortcode

 *  Resolved [davidebabylonia](https://wordpress.org/support/users/davidebabylonia/)
 * (@davidebabylonia)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/validation-error-on-thumbnail-shortcode/)
 * Hi, I catched one coding error in generate-thumbnail-code.php at line 121 & 123:
 *     ```
       $youtube_code .= '<img src="http://img.youtube.com/vi/' . $id . '/' . $version . '.jpg"';
   
       	if ( $width != '' ) { $youtube_code .= ' width="' . $width . 'px"'; }
   
       	if ( $height != '' ) { $youtube_code .= ' height="' . $height . 'px"'; }
   
       	$youtube_code .= ' alt="' . $alt . '"/>';
   
       	if ( !$nolink ) { $youtube_code .= '</a>'; }
       ```
   
 * It need to remove the “px” on both lines for don’t trigger an HTML5 validation
   error
 * [https://wordpress.org/plugins/youtube-embed/](https://wordpress.org/plugins/youtube-embed/)

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

 *  Plugin Contributor [David Artiss](https://wordpress.org/support/users/dartiss/)
 * (@dartiss)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/validation-error-on-thumbnail-shortcode/#post-6324075)
 * Thanks – will get that corrected.
 * David.
 *  Thread Starter [davidebabylonia](https://wordpress.org/support/users/davidebabylonia/)
 * (@davidebabylonia)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/validation-error-on-thumbnail-shortcode/#post-6324157)
 * Hi David, thanks for taking into consideration the fix, furthermore, if it’s 
   not too much job for you, I have noticed that the thumbnail shows sterile when
   displayed, without the play button, so I have temporarily solved this way:
 * `$youtube_code .= ' title="' . $alt . '" alt="' . $alt . '"/><img class="youtube-
   play" src="http://www.cookingwithpeachy.com/wordpress/wp-content/uploads/service/
   youtube-play-badge.png" width="120" height="98" title="Play on YouTube" alt="
   Play button"/>'; // cookingwithpeachy added title attribute and badge overlay`
 * where class=”youtube-play” is (in my case the thumbnail is 509x340px):
 * `.youtube-play{position:absolute;top:132px;left:195px}`
 * Do you think possible to implement this (in a better way) in the next release?
 * you can see it live [here](http://www.cookingwithpeachy.com/wordpress/buttered-chicken/):

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

The topic ‘Validation error on thumbnail shortcode’ is closed to new replies.

 * ![](https://ps.w.org/youtube-embed/assets/icon-256x256.png?rev=2955063)
 * [Embeds for YouTube](https://wordpress.org/plugins/youtube-embed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/youtube-embed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/youtube-embed/)
 * [Active Topics](https://wordpress.org/support/plugin/youtube-embed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/youtube-embed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/youtube-embed/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [davidebabylonia](https://wordpress.org/support/users/davidebabylonia/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/validation-error-on-thumbnail-shortcode/#post-6324157)
 * Status: resolved