I'm looking for something to create a multi footer with previous / next posts. The footer needs to know if the current post is the newest (1st, 2nd and 3rd newest), oldest (3rd, 2nd, and oldest) or in between.

As an example: enter image description here

The old / new links include title & thumbnail.

Does anyone know how I can achieve this?

1 Answer 1


Maybe I don't understand the question, sorry in that case.

But can't you just retrieve the last 6 posts excluding the current? Something like:

global $post;

$footer_posts = wp_get_recent_posts( array('post_status' => 'publish', 'posts_per_page' => '6', 'exclude' => $post->ID), 1 );

if ( ! empty($footer_posts) ) { foreach ( $footer_posts as $post ) {
  echo '<div style="float:left; margin-left:20px;">';
  echo '<a href="' . get_permalink() . '">';
  echo '<br /><h4 style="text-align:center;">' . get_the_title() . '</h4></a>';
  echo '</div>';
} }

  • Hey G.M. thanks for your comments but what don't you understand of the question? Then I can edit it.. I tried your solution but it seems not to work.
    – rwzdoorn
    Commented Aug 21, 2013 at 14:31
  • there was an error in code. I've edited the code adding som html decorations. Note that this works on single post view. For me works perfectly, what exactly doesn't work for you?
    – gmazzap
    Commented Aug 21, 2013 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.