Site logo

Archived topic

Pagination and Comments

9 replies · Started by John on December 19, 2018

Viewing posts 1–10 of 10

I want the ability to move the default wp pagination (ex: links to previous or next page) and comments form on a post to specific areas of my template using element hooks. How do I disable the out-of-box hooks and what wp functions do I need to use to solve my question?

PS I tried this several times and couldn't find a way to make this work the way I wanted. This is not a lazy post :)

Dave,

I'm not getting the results I want for moving the pagination where I want it to be. Below is the code from the post you mentioned with my updates to it. If you look at the example blog post (https://kelleyranaudo.com/healthy-holiday-vibes/) you will see that the pagination is above the comments area and not displaying in the proper div container with the text called "Custom pagination should go here".

hook code I am using:

So where do you want the nav to appear? Within its own separate container like the facebook comments are displayed?

I want the pagination links to appear in the their separate container called Custom pagination should go here”.

David - did my last reply makes sense?

I'm getting close. This is what I have but it has errors.

<?
add_action( 'generate_before_comments_container', 'jr_move_post_nav' );

function jr_move_post_nav() {
    if ( function_exists( 'generate_content_nav' ) && is_single() ) {
        previous_post_link('&laquo; &laquo; %', '', 'yes'); 
        next_post_link('% &raquo; &raquo; ', '', 'yes');
    }
    
}
?>

That code looks ok - what errors are you getting?

How is the News on Blog section being added?

This archived topic is closed to new replies.