[Support request] Pagination and Comments

Home Forums Support [Support request] Pagination and Comments

Home Forums Support Pagination and Comments

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #761025
    John

    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 🙂

    #761063
    David
    Staff
    Customer Support

    Hi there,

    in this topic Tom provides the code for hooking the post nav elsewhere:

    https://generatepress.com/forums/topic/moving-the-post-navigation-above-the-entry-header/#post-362798

    This article displays the main hooks you can use, just swap accordingly:

    https://docs.generatepress.com/article/hooks-visual-guide/

    #761092
    John

    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:

    #761233
    David
    Staff
    Customer Support

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

    #761375
    John

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

    #761561
    John

    David – did my last reply makes sense?

    #761627
    John

    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');
        }
        
    }
    ?>
    #761694
    Tom
    Lead Developer
    Lead Developer

    That code looks ok – what errors are you getting?

    #761724
    John

    Tom – below are screen shots and the url to the actual page.
    what is displayed on the pagewhat is displayed on the page

    The page nav code used in the elementThe page nav code used in the element

    page: https://kelleyranaudo.com/weekly-vibes-it-is-december/

    #761935
    David
    Staff
    Customer Support

    How is the News on Blog section being added?

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.