December 2017
Beginner
458 pages
7h 52m
English
Next, what we'll do is check to see if there's a thumbnail or a featured image. For this, we'll add an if statement:
<?php if() : ?></article>
In the if statement, add has_post_thumbnail() and let's end the if statement as shown here:
<?php if(has_post_thumbnail()) : ?><?php endif; ?></article>
If there's a thumbnail, we'll create <div> and give it a class of post-thumbnail. In <div> we'll add <?php the_post_thumbnail(); ?> as shown here:
<?php if(has_post_thumbnail()) : ?> <div class="post-thumbnail"> <?php the_post_thumbnail(); ?> </div><?php endif; ?>
Now, under the if block add a <br /> tag, and then we will need the main content which is really easy; we can just add <?php the_content(); ?> as shown ...
Read now
Unlock full access