Adding Post Thumbnails support to our WordPress theme

Adding post thumbnails to your WordPress theme is pretty simple. The starter theme we are using actually includes the necessary code in the functions file, we just need to uncomment it. This tutorial will also show you the markup that needs to go into our page templates in order to display the post featured image. […]

You need to have an active subscription to view this content.

Register Here!
  • Abu Jorhom

    I can’t stop watching and applying the tutorials. Honestly, flawless.

  • I noticed the featured images are distorted, even yours, I added this to the functions:
    add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10 );
    add_filter( ‘image_send_to_editor’, ‘remove_thumbnail_dimensions’, 10 );
    function remove_thumbnail_dimensions( $html ) {
    $html = preg_replace( ‘/(width|height)=”d*”s/’, “”, $html );
    return $html; }

    Is there a better way?

  • Hey Brad, thanks for the tuts. Would be good to show how to wrap text around the thumbnails in the single post and archive pages.

    When I just did “sample text” in the post as you did, the image extended into the next article instead of clearfix-ing itself a break between them.

    Weird, maybe.

  • Wow Brad i take so much pleasure in this courses i will recommended it. It’s fun it’s well think and demonstrate. Video + Code is a very nice feature. Just the sound on the first part (i hope it’s better for the next chapters) should be better… i didn’t qualify it i’m sure you know. This tutorials is excellent. I really learn a lot here and it’s so nice. THANKS AGAIN BRAD

    • Thanks for the feedback. The sound quality does get better as you move forward. I purchased a new mic. =)

      • Yes you right ! 🙂 I buyed StrapPress because i really learnt for the first session hope it’s help a bit. I hope you will add a session when Bootstrap 4 will pass from alpha to public release. Also i’m wondering why you choose to opt for redux framework to get the options panel as Redux now goes to respect the next move from wordpress to force developers to choose to put all in the customizer… i think it’s like adobe with extensions and his next move to ADD-ONS marketplace… probably to get at a certain point in the time better pageload and less error for everyone and every skills.

        (If you’ve not yet heard, WordPress.org has mandated there be NO settings API based option panels of any kind for themes hosted on WordPress.org. Existing themes still using option panels will be required to remove said panels and add customizer ONLY options before updating. New themes must adhere to this new guideline, or be rejected. The WordPress.org theme review team has essentially stopped WordPress.org theme devs from using most option frameworks. Fear not, we have a solution. We are enhancing Redux to work fully in the Customizer!).

        • Yes, I have plans to go over how to implement Bootstrap 4 into a WordPress theme once it is out of alpha.

          I picked Redux, b/c at the time WordPress.org didn’t require the use of the customizer. Note: you only have to use the customizer if you plan on submitting your themes to the WordPress.org repo. If you want to make premium theme to sell or give to your clients, then you can use whatever you want.

          With that said, I am going to do a tutorials series on the customizer settings and how to use the options within a theme. That way, you will learn and understand how to use both options.

          • That’s quite nice Brad ! Really great idea – I know you talk about Disqu’s i don’t know if you cover the way to implemented it as well… (as the portfolio seem to doesn’t include porfolio with more than one photos maybe all that is cover in next sessions) Shoul be nice to see some nice and useful integration like lightbox or something… If fact only the ones who’s very useful and lightweight then people can choose to include in the theme or not… ANYWAY the place HERE is exactly what i was looking for to LEARN /* THANKS */

          • I’m sorry to asked questions before to finished the courses. The way you integrated Redux is quite nice Brad. I’m usually interested by the WP Customizer courses to know two ways. But i must admit Redux is a nice addition to the whole thing.

  • Violet Asmus

    Hi, i must say that i am enjoying the course. It’s all starting to make sense. I have one question though regarding the post-thumbnail. I followed every step but somehow my thumbnail isnt showing.

    • Did you inspect the element and see if you have any errors? If you are still having problems please create a topic in the support forum.

  • kulkarni

    Hi Brad

    I have accidentally removed the right sidebar, I went to widget to reactivate it but don’t see it. so how do I reactivate it.

    • You probably removed the code that registers the sidebar in the functions file. If you can’t figure out the code you removed please create a topic in the forum.