1

In the wordpress theme I am developing I inserted some code to display links to the previous and next posts which appears at the bottom of each post. The code looks like this..

<?php previous_post_link(); ?>
<?php next_post_link(); ?>

The problem is that these arrows << and >> appear next to them. Does anyone know how to get rid of them? Any help will be appreciated.

6

You should have to look at what the codex says about

previous_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )

and

next_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' )

Both have the same parameters, the first parameter $format is the important one to have a look at here

Format string for the link. This is where to control what comes before and after the link. '%link' in string will be replaced with whatever is declared as 'link' (see next parameter). 'Go to %link' will generate "Go to

Default: '&laquo; %link'

If you need to remove the &laquo;, you can just simply override it like this

<?php previous_post_link('%link'); ?>
| improve this answer | |
  • @user1181153 Please accept my answer then by clicking on the checkmark next to my answer. Thanks – Pieter Goosen Jul 7 '14 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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