• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to disable pagination

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How to disable pagination

This topic is: not resolved

Tagged: archive pagination

  • This topic has 13 replies, 3 voices, and was last updated 6 years, 8 months ago by jimbo5.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • September 11, 2018 at 2:18 am #223122
    nicole2014
    Member

    I just noticed that on all pages (not posts) I have many versions of the same page under site.com/page/1 and I can substitute any number and it will still show as a new URL with the same content.
    I would like to disable pagination and add a 301 to the same page with no page/number

    Any help will be much appreciated.

    Thanks!

    http://creativecertificates.com
    September 11, 2018 at 7:56 am #223130
    Brad Dalton
    Participant

    This code may still work https://gist.github.com/braddalton/5030437

    It removes the pagination from archives, not the single post navigation.

    Seems you also need code to add a 301 redirect


    Tutorials for StudioPress Themes.

    October 19, 2018 at 9:04 am #223861
    jimbo5
    Participant

    Hi, I´m having the same problem. I´ve been trying to remove the pagination from the archives page with no luck.

    I put

    remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );

    before the closing genesis();

    in /wp-content/themes/genesis/page_archive.php

    but is not working, the pagination is still there.

    The URL with the problem is https://www.lagrimasartificiales.net/informacion/

    October 19, 2018 at 9:21 am #223862
    Brad Dalton
    Participant

    Never edit genesis files.

    Add the code to a archive.php file in your child themes or use it in functions.php with a hook and conditional tag.


    Tutorials for StudioPress Themes.

    October 19, 2018 at 9:31 am #223863
    jimbo5
    Participant

    My child is Executive Pro and I can´t find the archive.php file there

    October 19, 2018 at 9:41 am #223864
    Brad Dalton
    Participant

    You will need to create one.

    <?php
    
    //Add the code here
    
    genesis();
    

    Tutorials for StudioPress Themes.

    October 19, 2018 at 10:12 am #223865
    jimbo5
    Participant

    ?‘? Thank you very much 🙂

    Now the problem is that the page only shows 6 posts of the category archive 🙁

    October 19, 2018 at 10:38 am #223867
    Brad Dalton
    Participant

    Yes, You can change that in the Genesis > Theme Settings > Content Archive settings

    Or

    Using code like pre_get_posts with the posts per page parameter


    Tutorials for StudioPress Themes.

    October 19, 2018 at 10:45 am #223868
    jimbo5
    Participant

    I´ve already got it in 50 posts.

    October 19, 2018 at 10:50 am #223869
    jimbo5
    Participant

    Something like this?

    <?php
    add_action('pre_get_posts', 'filter_press_tax');

    function filter_press_tax( $query ){
    if( $query->is_tax('press') && $query->has_term('press')):
    $query->set('posts_per_page', 20);
    return;
    endif;
    }
    ?>

    October 19, 2018 at 11:08 am #223870
    Brad Dalton
    Participant

    Yes or this code with a conditional tag in functions.php.


    Tutorials for StudioPress Themes.

    October 19, 2018 at 12:16 pm #223873
    jimbo5
    Participant

    Yes! I´ve used yours and it´s working perfectly.

    That you very much for your help 🙂

    By the way, your website is veeeery useful 🙂 🙂

    October 19, 2018 at 12:39 pm #223874
    jimbo5
    Participant

    No, is not working xDDDD

    October 19, 2018 at 12:44 pm #223875
    jimbo5
    Participant

    Yes, it was the caché, sorry 😉

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble