[Support request] Next and previous links

Home Forums Support [Support request] Next and previous links

Home Forums Support Next and previous links

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #764289
    Matthew

    Hi,

    I can’t figure out how to get next and previous links to appear natively with GeneratePress?

    Right now I am using toolset to insert them but this creates URLs with query strings on the end for some reason.

    What should I target to get them to appear? Or is there some setting I am missing?

    #764293
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can tell GP to include the footer meta in your custom post type like this: https://docs.generatepress.com/article/generate_footer_meta_posts_types/

    Let me know if that helps or not 🙂

    #764311
    Matthew

    Hey Tom,

    Thanks for the quick reply!

    Tried but this doesn’t seem to do anything. :-/

    #764481
    Tom
    Lead Developer
    Lead Developer

    Can you show me the code you added?

    #767462
    Matthew

    Hey

    Yeah sure I added the following:

    add_filter( 'generate_footer_meta_posts_types', function( $types ) {
        $types[] = 'tv_show';
          $types[] = 'tv-show';
    
        return $types;
    } );

    Just to be safe as I am unsure if its tv_show or tv-show as I changed it from tv_show to tv-show.

    #767957
    Tom
    Lead Developer
    Lead Developer

    Ah, I think that code will only work on post type archives.

    Since you’re using a shortcode to output posts, the pagination would need to come from the shortcode.

    It looks like you’re using WP Show Posts. Is the pagination option not working?

    #769241
    Matthew

    For the archive pages we are using Toolset templates.

    They can do pagination but for some reason their pagination adds strange query strings on to the end of URLs, something they said is normal for Toolset.

    Our last theme pagination appeared by default on CPT, is there no way to support this, add a WordPress supported shortcode to have pagination appear from GP?

    I can edit the template to add in code where it would normally appear? Just not sure what code to use.

    Cheers.

    #769287
    Tom
    Lead Developer
    Lead Developer

    You could try this function: https://codex.wordpress.org/Function_Reference/the_posts_pagination

    That the core WP way to add pagination.

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