WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

im working on default wordpress theme twenty eleven, i just wanted to know how can i wrap this previous and next anchor with an image or next/previous button?

<span class="nav-previous"><?php previous_image_link( false, __( '&larr; Previous' , 'twentyeleven' ) ); ?></span>
<span class="nav-next"><?php next_image_link( false, __( 'Next &rarr;' , 'twentyeleven' ) ); ?></span>
share|improve this question
up vote 0 down vote accepted

Try passing in the image into the functions themselves:

$previous_image = "<img src='http://domain.com/path/to/image/' alt='Previous Posts'>";
$next_image = "<img src='http://domain.com/path/to/image/' alt='Newer Posts'>";

<span class="nav-previous"><?php previous_image_link( false, $previous_image ); ?></span>
<span class="nav-next"><?php next_image_link( false, $next_image ); ?></span>
share|improve this answer
Thanks Brian, Let me try this one. – XeBii Sep 2 '12 at 4:59
Thanks Brian, your suggested answer solved my problem. Really appreciated your help :) – XeBii Sep 2 '12 at 5:51

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.