I'm trying to add pagination support for some longer posts on my site. I've added the wp_link_pages() function to my single.php file, after the_content, but this causes the pagination links to display under some end-of-post plugins I have (YARPP and Better Author Bio, if that matters).

I'd like the pagination links to appear at the end of the actual content, before any filter hooks are added. How can I do this without editing the the get_the_content function in wp-includes/post-template.php? Do I need to write a plugin?

1 Answer 1


That's because you have directly edited the single.php file, try to make a function and in it return wp_link_pages() and in add_action set a priority. Try this function

function pagination_after_post()
 return wp_link_pages();


My WP PHP is not that good, my function might be wrong, this is just an example, but this way you can get pagination exactly after post


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.