• Resolved ergkranjan

    (@ergkranjan)


    Hi Team,

    I would like to move post navigation from bottom end to just below the content and or at top of the content. Because if I have 100 comments, no one would like to scroll down at the bottom for post navigation.

    Please help on this Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ergkranjan

    (@ergkranjan)

    Hi Team, Please help on this.

    Hello,
    adding this to your child-theme functions.php should do the trick:

    add_action('wp_head', 'swap_comments_post_nav');
    function swap_comments_post_nav(){
      if ( ! method_exists('TC_post_navigation', 'tc_post_nav') )
        return;
      remove_action('__after_loop', array(TC_post_navigation::$instance, 'tc_post_nav'), 20 );
      add_action('__after_loop', array(TC_post_navigation::$instance, 'tc_post_nav'), 9 );
    }

    Thread Starter ergkranjan

    (@ergkranjan)

    Hi Friend,

    It did the trick, but still the position is below the author details. Can I move it just below the post or you can say above the author detail.

    Thread Starter ergkranjan

    (@ergkranjan)

    Hi Friend,

    Thanks for your support.

    I have done the this by using below code:

    add_action(‘wp_head’, ‘swap_comments_post_nav’);
    function swap_comments_post_nav(){
    if ( ! method_exists(‘TC_post_navigation’, ‘tc_post_nav’) )
    return;
    remove_action(‘__after_content’, array(TC_post_navigation::$instance, ‘tc_post_nav’), 20 );
    add_action(‘__after_content’, array(TC_post_navigation::$instance, ‘tc_post_nav’), 9 );
    }

    Thread Starter ergkranjan

    (@ergkranjan)

    //Here is the final code:

    //Forgot to add is_single check:

    add_action(‘wp_head’, ‘swap_comments_post_nav’);
    function swap_comments_post_nav(){
    if ( ! method_exists(‘TC_post_navigation’, ‘tc_post_nav’) )
    return;
    if (is_single() )
    {
    remove_action(‘__after_content’, array(TC_post_navigation::$instance, ‘tc_post_nav’), 20 );
    add_action(‘__after_content’, array(TC_post_navigation::$instance, ‘tc_post_nav’), 9 );
    }
    }

    Good, thanks for sharing ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post navigation at top or just below post’ is closed to new replies.