Title: Set HTML width and height
Last modified: August 30, 2016

---

# Set HTML width and height

 *  [cwfaraday](https://wordpress.org/support/users/cwfaraday/)
 * (@cwfaraday)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/set-html-width-and-height/)
 * GTMetrix and other speed tests complain when the HMTL height and width aren’t
   set for images. I modified the recent-posts-widget-extended/includes/functions.
   php file as follows to add the dimanesions of thumbnails a couple of lines below
   the `// Check if post has post thumbnail.` comment:
 *     ```
       if ( $image ) :
       										$html .= '<img class="' . esc_attr( $args['thumb_align'] ) . ' rpwe-thumb" src="' . esc_url( $image ) . '" alt="' . esc_attr( get_the_title() ) . '" width=' . $args['thumb_width'] . ' height=' . $args['thumb_height'] . '>';
       ```
   
 * Assuming this is something that can benefit everybody, maybe the developer might
   include it in a future release.
 * In any case, thanks for a great plugin!
 * [https://wordpress.org/plugins/recent-posts-widget-extended/](https://wordpress.org/plugins/recent-posts-widget-extended/)

The topic ‘Set HTML width and height’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recent-posts-widget-extended_3384ca.
   svg)
 * [Recent Posts Widget Extended](https://wordpress.org/plugins/recent-posts-widget-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recent-posts-widget-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recent-posts-widget-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-posts-widget-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-posts-widget-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-posts-widget-extended/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [cwfaraday](https://wordpress.org/support/users/cwfaraday/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/set-html-width-and-height/)
 * Status: not resolved