Next and previous post images

The Next and Previous post links guide your visitor through your WordPress site. When it comes to creating strong site-wide navigation, some of the most powerful tools for moving your visitor around are these link tags. Adding this PHP code to your wordpress theme will display image links for your next and previous posts. Upload images to your theme with the name next.png and prev.png.

 

 

<?php
next_post_link( '%link', '<img src="' . get_bloginfo('stylesheet_directory') . '/img/prev.png" />');
?>
<?php
previous_post_link('%link', '<img src="' . get_bloginfo('stylesheet_directory') . '/img/next.png" />' );
?>

Leave a comment