WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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>';
} }

share|improve this answer
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 Aug 21 '13 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 Aug 21 '13 at 15:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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