• 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

custom loop on page

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 › Design Tips and Tricks › custom loop on page

This topic is: not resolved

Tagged: custom loop

  • This topic has 6 replies, 3 voices, and was last updated 9 years, 11 months ago by Genesis Developer.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • June 19, 2015 at 4:41 pm #156854
    mmjaeger
    Member

    Hello
    I'm a little lost at the moment - I've a page with a custom loop - what happens is that the page title is not shown when using the custom loop - how do you deal with this - one way as I see it is to put back the page title like this:

    printf( '<div class="entry">
    				<header class="entry-header">
    					<h1 class="entry-title">%s</h1>
    			 	</header>
    			 </div>',
    			 get_the_title() );

    the other option I guess would be to run a 2nd loop after the page entry - am I missing something here - what's the preferred way to handle this?

    Thank you in advance for your help.

    June 19, 2015 at 7:22 pm #156873
    Christoph
    Member

    Hi,

    hmm... hard to tell without seeing your custom loop.

    Did you end it with genesis();?

    Here are some examples of custom loops, sorry if you already know about them:

    gregrickaby.com/genesis-code-snippets/
    gist.github.com/billerickson/3218052
    genesissnippets.com/genesis-custom-loop/


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    June 19, 2015 at 8:09 pm #156879
    mmjaeger
    Member

    Yes I did end it with genesis() - I basically have something like outlined at genesissnippets.com/genesis-custom-loop/ using a custom page template - everything works fine - I just don't know what the best way would be to show the page title since the custom loop replaces the primary loop, the page doesn't output its page title?

    June 22, 2015 at 8:37 am #157159
    mmjaeger
    Member

    I'm still looking for some insight how to do this.

    Thanks again.

    June 22, 2015 at 9:53 am #157167
    Genesis Developer
    Member

    I used following code. It is showing Page Title and removing the Page Content.

    <?php
    /**
      * Template Name: Custom Loop
      */
    
    /** Replace the standard loop with our custom loop */
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    add_action( 'genesis_after_loop', 'child_do_custom_loop', 20 );
     
    function child_do_custom_loop() { 
        global $paged; // current paginated page
        global $query_args; // grab the current wp_query() args
        $args = array(
            'post_type' => 'listing', // exclude posts from this category
            'paged'     => $paged, // respect pagination
        );
        
        add_action( 'genesis_entry_content', 'genesis_do_post_content' );
         
        genesis_custom_loop( wp_parse_args($query_args, $args) );
    }
    
    genesis();

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    June 22, 2015 at 9:56 am #157169
    mmjaeger
    Member

    so you're adding a secondary loop and not replacing the primary loop, right - does the pagination word on the secondary loop?

    Thanks again.

    June 22, 2015 at 10:27 am #157171
    Genesis Developer
    Member

    yes. pagination will work. Try once. You will modify the code. I am using "listing" post type in the loop


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ 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