Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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();
}

add_action('the_content','pagination_after_post',1);

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

share|improve this answer
    
That makes sense. Let me play with that and then I'll throw you the big green check mark. –  hookedonwinter Sep 14 '11 at 14:36
    
It worked, but now I'm having other issues. Opening a new question. Thanks for your help! –  hookedonwinter Sep 14 '11 at 16:52
    
@hookedonwinter your welcome –  ntechi Sep 14 '11 at 17:58
    
If you're interested.. here's the followup wordpress.stackexchange.com/questions/28526/… –  hookedonwinter Sep 14 '11 at 18:11

Your Answer

 
discard

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.