[Resolved] How to move pagination on multi-page posts

Home Forums Support How to move pagination on multi-page posts

  • This topic has 5 replies, 2 voices, and was last updated 3 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1329809
    Keir

    On my site, whenever I create a multi page post (using page-break tags/block) the pagination appears after the WP likes and my social sharing buttons which means people miss the navigation. (div.page-links)

    Can I move it to before these using a code snippet? (I have the plugin)

    Also, is there any way of adding next-page, previous page links? The ones you can see on the page I have linked to have been manually added using generate blocks – but this is a suboptimal solution.

    #1329834
    David
    Staff
    Customer Support

    Hi there,

    do the WP Likes and Social Sharing plugins provide shortcodes ( or PHP functions ) to display theml?

    If so you can use a Hook Element to add them to your posts:

    https://docs.generatepress.com/article/hooks-element-overview/

    If you select the after_content hook they will appear after the Pagination.

    Post Navigation (Next / Previous) post is an option in Customizer > Layout > Blog:

    https://docs.generatepress.com/article/blog-content-layout/

    #1329912
    Keir

    Thanks for the prompt reply and the tips.

    I’ve been able to move the social sharing buttons via shortcode – so thanks for that.

    The like button looks more complicated (https://jetpack.com/2013/06/10/moving-sharing-icons/) I don’t really understand php, so I would be stabbing in the dark trying to implement the code they give here.

    In the meantime, I have used css to position the ‘likes’ in the right place using position relative. It’s a bodge, but it produces the right visual effect for now.

    #1329921
    David
    Staff
    Customer Support

    For the Likes try this:

    1. Add this PHP Snippet to your site:

    function jptweak_remove_share() {
        remove_filter( 'the_content', 'sharing_display', 19 );
        remove_filter( 'the_excerpt', 'sharing_display', 19 );
        if ( class_exists( 'Jetpack_Likes' ) ) {
            remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
        }
    }
     
    add_action( 'loop_start', 'jptweak_remove_share' );

    https://docs.generatepress.com/article/adding-php/

    In theory that should remove the Likes button.

    2. Then in your Hook Element add:

    <?php
    if ( class_exists( 'Jetpack_Likes' ) ) {
        $custom_likes = new Jetpack_Likes;
        echo $custom_likes->post_likes( '' );
    }
    ?>

    Make sure to check Execute PHP for that one

    #1330158
    Keir

    Brilliant!

    That’s given me lots of possibilities to play around with.

    THANK YOU!

    #1330227
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.