• 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

Genesis_custom_loop next page link does not work on homepage.

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 › Genesis_custom_loop next page link does not work on homepage.

This topic is: not resolved

Tagged: genesis custom loop, genesis homepage, genesis_custom_loop, homepage, next page link, pagination

  • This topic has 4 replies, 4 voices, and was last updated 11 years, 6 months ago by bittheory.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • December 9, 2013 at 10:10 am #77837
    [email protected]
    Member

    I've created a template with a custom loop and set it as my homepage. Everything works fine when the page is not set as the homepage, but when I do, the 'next page' link stops working.

    This is because, when I set the page as the homepage, the next page link drops the page slug from the link.
    So, instead of
    http://mysite.com/my-custom-loop-page/page/2/
    it gets changed to
    http://mysite.com/page/2/
    and the loop just starts over again.

    What I really need is someway to conditionally change the next page link so that it will work on the homepage.
    If it's any help, here's the template:

    /* Template Name: Newsroom */ 
    
    /*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 newsroom_custom_loop() {
    
    		global $paged;
    		global $query_args;
    
    		$args = array(
    		'thumb' => true,
    		'post_type' => 'post',
    		'author' => '16',
    		'paged' => $paged,
    		'posts_per_page' => 8
    		);
    		
    	return genesis_custom_loop( wp_parse_args($query_args,$args) );
    }
    
    add_filter( 'genesis_loop', 'newsroom_custom_loop');
    
    genesis();
    February 19, 2014 at 11:47 am #91197
    Susan
    Moderator

    Hi! Since it's been a while since you posted your question, I hope you were able to get it resolved.

    If not, please report back here, and I will try to assist, or will escalate.

    Thanks!

    April 16, 2014 at 4:59 pm #100847
    bittheory
    Member

    Hi,

    Hope it's okay to post. I have the same problem - the page slug is dropped in pagination buttons when page is set as homepage and posts do not advance but the same page works when not set as hompage. Did you resolve the problem and if so, how?

    Regards,
    Fred

    April 20, 2014 at 10:10 pm #101580
    davebonds
    Member

    Try adding your page slug as a pagename parameter to the query args. Replace sample-page with your page slug:

    'pagename' => 'sample-page',

    So this:

    $args = array(
    		'thumb' => true,
    		'post_type' => 'post',
    		'author' => '16',
    		'paged' => $paged,
    		'posts_per_page' => 8
    		);

    Becomes this:

    $args = array(
    		'thumb' => true,
    		'post_type' => 'post',
    		'author' => '16',
    		'pagename' => 'sample-page', 
    		'paged' => $paged,
    		'posts_per_page' => 8
    		);
    April 24, 2014 at 3:47 pm #102234
    bittheory
    Member

    Hidavebonds,

    Thanks for that. Sorry for the delay in responding. Going to go try that out - I'm guessing that combining the above with is_front_page will allow for customizing it only for home. Might need to also check if a static page is used as well. Or I could be over complicating things. Will play with it and see what happens!

    Regards,
    Fred

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