• 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

Next Page Pagination links do not work with genesis_custom_loop

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 › Next Page Pagination links do not work with genesis_custom_loop

This topic is: resolved

Tagged: genesis_custom_loop, pagination

  • This topic has 2 replies, 1 voice, and was last updated 12 years, 10 months ago by [email protected].
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 5, 2013 at 1:00 pm #77260
    [email protected]
    Member

    I'm setting up a really simple custom loop using genesis_custom_loop() and I'm doing this in several templates on our site. I just realized that the "Next Page" link is not working on any of the pages where I'm using it and I need to fix it. I'm not doing anything fancy. Here's an example of how I'm using it (This is a template file in my child theme)...

    <?php /* Template Name: From the Newsroom */ 
    
    /*Use the Genesis custom loop to create loop for posts by a certain author
     *For parameters see: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters*/
    function uthsc_newsroom_custom_loop() {
    		$args = array(
    		'thumb' => true,
    		'post_type' => 'post',
    		'author' => '16'
    		);
    		
    	return genesis_custom_loop( $args );
    }
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'uthsc_newsroom_custom_loop' );
    
    genesis();

    Here's one I'm using to get a loop for a custom post type:

    <?php /* Template Name: Listservs */ 
    
    /*Use the Genesis custom loop to create loop for my custom post type
     *For parameters see: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters*/
    
    function uthsc_announcement_custom_loop() {
    		$args = array(
    		'thumb' => true,
    		'post_type' => 'announcement',
    		);
    		return genesis_custom_loop( $args );
    }
    add_filter( 'genesis_loop', 'uthsc_announcement_custom_loop');
    genesis();

    The custom loop seems to work great but, when you click the "Next Page" link, it adds 'page/2/' to the url but still loads the loop from the beginning.
    Am I missing something simple here?

    http://news.uthsc.edu/announcements
    December 5, 2013 at 1:03 pm #77262
    [email protected]
    Member

    Also, just a note: notice In my first example I removed the loop and added my own and, in the second example, I filtered it. I get the same problem with both methods.

    December 5, 2013 at 1:15 pm #77264
    [email protected]
    Member

    Ok, did some more digging and I figured it out.
    Inside of your custom loop, you need to call global $paged and set 'paged' => $paged in your $ args.

    so the custom loop function ends up looking like this:

    function uthsc_listserv_custom_loop() {
    		global $paged;
    
    		$args = array(
    		'thumb' => true,
    		'taxonomy' => 'listserv',
    		'post_type' => 'announcement',
    		'paged' => $paged,
    		);
    		return genesis_custom_loop( $args );
    }

    BAM! It works. Cool feature bro.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2026 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