December 2017
Beginner
458 pages
7h 52m
English
As we want to check for the thumbnail, as we did in the previous section, we will use the same code in the content-gallery.php page:
<div class="w3-col m4 l4 pic"> <?php if(has_post_thumbnail()) : ?> <div class="post-thumbnail"> <?php the_post_thumbnail(); ?> </div> <?php endif; ?></div>
This is going to be a little different than the regular content post. We will remove the <?php the_post_thumbnail(); ?> line. After removing it, the code should look like the following:
<div class="w3-col m4 l4 pic"> <?php if(has_post_thumbnail()) : ?> <div class="post-thumbnail"> </div> <?php endif; ?></div>
Read now
Unlock full access