Media Planning and Buying Project Management Graphic Design Interactive Commercial Printing Public Relations Writing
Why Hire Us? Testimonials Philosophy Our Team Career Opportunities Contact Us
Home     Contact     Support
7
Apr
09

Create an Explore block to display general info about your posts in WordPress

So, how do you get your readers to explore the rest of your blog posts? Maybe you can offer them some more information about the post they’re on, as well as some convenient links to the post(s) immediately following or preceding the post they’re looking at. The magic code, which you’ll want to add into the sidebar next to your single.php page is as follows -

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <ul class="exploreThese">
      <?php /* if previous post exists */ previous_post_link('<li>Older: %link</li>') ?>
      <?php /* if next post exists */ next_post_link('<li>Newer: %link</li>'); ?>
      <li>Category: <?php the_category(', ') ?></li>
      <?php the_tags( '<li>Tag: ', ', ', '</li>'); ?>
    </ul>
<?php endwhile; else: endif; ?>

Fix the php tags, do a little CSS magic on it to get it to style nicely with the rest of your blog and that’s it! You can see it live in (modified) action in the sidebar on this site. ->

If you enjoyed this post, make sure you subscribe to my RSS feed!
Cas Johnson is the Lead Web Developer at Absolute Marketing Group in Moorhead, Minnesota. She volunteers her time for the FMVA, enjoys being a wife and mom, and attempts to keep edible plants alive through the short Northern summer.

Post a Comment

Your email is never shared. Required fields are marked *

*
*

Client Login






Go to login

Absolute Truth

Sign up for our newsletter






Read the absolute truth online

Learn more about the absolute truth