December 2017
Beginner
458 pages
7h 52m
English
Now, in the single.php file, we just have a static image:
<img src="images/1.jpg" class="pic w3-animate-right">
To change the static image, let's copy the if statement we have in the content-gallery.php file and paste that in place of the <img> tag as shown here:
</p> <hr/> <?php if(has_post_thumbnail()) : ?> <div class="post-thumbnail"> <?php $attr = array( 'class' => 'w3-animate-opacity w3-hover-opacity' ); ?> <a href="<?php echo the_permalink(); ?>"> <?php echo get_the_post_thumbnail($id, 'large', $attr); ?> </a> </div> <?php endif; ?> <?php the content(); ?></div>
In this code, we will change w3-animate-opacity to w3-animate-right and remove w3-hover-opacity as shown here:
<?php if(has_post_thumbnail()) ...
Read now
Unlock full access