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

How can I make the arrow as part of the link please?

<?php next_post_link('%link &rarr;'); ?>

The output of above will be | <a href="nextPostLink">NextPostTitle<a> arrow |

share|improve this question

As the documentation for next_post_link states, the link parameter is where the actual text of the %link placeholder goes. The format parameter is the whole text, where %link is unpacked from the second link parameter. Solution:

next_post_link( '%link', '%title &rarr;' );

Expected output: <a href="...">Title &rarr;</a>

Something like this, on the other hand:

next_post_link( 'Over to %link now!', '-- %title --' );

...will result in: Over to <a href="...">--- Title ---</a> now!

See how these are unpacked?

share|improve this answer

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.