• 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 for Blog page – not working

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 for Blog page – not working

This topic is: not resolved

Tagged: blog, custom loop, custom template, genesis

  • This topic has 9 replies, 2 voices, and was last updated 10 years, 8 months ago by JamesRoberts.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • October 29, 2014 at 1:54 pm #129788
    GregThrive
    Member

    Hello all, hoping someone here can pick out what I'm doing incorrectly. I contacted StudioPress directly but they just gave a generic answer which was most unhelpful.

    OS: Any
    Browser: Any

    I'm trying to create a custom blog template:

    What i've done:

    1. Created a template file out of the wordpress naming hierarchy

    2. Created a custom loop based on genesis_standard_loop inserted into
    template

    3. remove_action( 'genesis_loop', 'genesis_do_loop' ); and/or remove_action( 'genesis_loop', 'genesis_standard_loop' );

    4. add_action( 'genesis_loop', 'custom_blog_loop' );

    5. Created page, arbitrarily named (but want it named Blog)

    6. Selected custom template on page

    At this stage, if you load the page you can see the WYSIWYG content and
    some test code i placed within the custom blog loop showing. No blog posts
    are pulled in because it's just a page with no idea where blogs are...

    7. Under WordPress settings: Reading - set Posts page to my arbitrarily named Blog Page.

    At this stage, the template no longer has any effect and the page is displaying the default blog loop from Genesis framework (genesis_standard_loop).

    How do I set my custom page to the Posts Page while using a custom loop in a custom template?

    Thanks for any assistance!

    http://local
    October 29, 2014 at 2:08 pm #129789
    JamesRoberts
    Member

    Hi Greg,

    Just so I understand completely, you are trying to create a custom page template that you would like to use as your blog page, is that correct?

    Is this blog page going to be styled differently than the other archive pages? If not then you may be better off creating a custom archive page rather than a page template.

    Would it be possible to show the code you have running in your custom loop function?


    Need beautiful and responsive Genesis child themes at amazing prices? Stop by LlamaPress and check out our themes.

    October 29, 2014 at 2:24 pm #129793
    GregThrive
    Member

    James,

    Just so I understand completely, you are trying to create a custom page template that you would like to use as your blog page, is that correct?

    Yes that's correct. More specifically I'd like to set my default blog category to 'blog', add '/%category%/' to my permalinks and create a custom Blog page (I want to leverage some functionality of it being a page). Ideally all archives and the blog page will share common markup, but I haven't gotten that far yet. I need custom markup outside of what the standard Genesis loop offers.

    My custom loop function is a carbon copy of the genesis_standard_loop with a simple addition of an H1 for now to test that it is infact the loop being displayed. No other changes have been made.

    October 29, 2014 at 2:37 pm #129794
    JamesRoberts
    Member

    Humm, if you replace the code in your custom loop with the following, do you see any blog posts?

    if ( have_posts() ) :
    	while ( have_posts() ) : the_post();   
    	    echo "<h2>" .  get_the_title() . "</h2>";
    	endwhile;
    endif;

    Need beautiful and responsive Genesis child themes at amazing prices? Stop by LlamaPress and check out our themes.

    October 29, 2014 at 3:19 pm #129804
    GregThrive
    Member

    The template is not being read once the page has been set to Posts Page under Settings -> Reading.

    Once that page has been set as the blog page, nothing in the template has any affect. So the above code, or any code at all on the template or any markup of any kind is not working.

    When "X" page is set as the blog page Genesis Standard Loop takes over. I have no idea why, this is my first Genesis site.

    Note that I have other custom template with custom loops that work fine, it's something about setting the Posts Page in WordPress that blows this up.

    October 29, 2014 at 3:21 pm #129805
    GregThrive
    Member

    Here is the template code: Should be pretty basic:

    http://pastie.org/9684252

    -Greg

    October 29, 2014 at 3:39 pm #129809
    JamesRoberts
    Member

    I see. I beleive WordPress will ignore the page template for any page that is set to the posts page. It might be worth you trying this https://wordpress.org/plugins/posts-page-custom-template/, note I have not tried that myself but reading the description it seems to allow you to set page templates to the post page.


    Need beautiful and responsive Genesis child themes at amazing prices? Stop by LlamaPress and check out our themes.

    October 29, 2014 at 3:59 pm #129810
    GregThrive
    Member

    Ah yeah, you are correct. Though if I named the template home.php that should work or so I thought...

    October 29, 2014 at 4:09 pm #129812
    GregThrive
    Member

    Well home.php didn't work for whatever reason. Which is what I had originally set the template name as from memory but then scrapped it when it wasn't working!

    However, thanks to you refreshing my memory on the template naming I named the template index.php and now it gets picked up properly.

    I had to add
    remove_action( 'genesis_loop', 'genesis_do_loop' ); vs.
    remove_action( 'genesis_loop', 'genesis_standard_loop' );

    But hey, it's working as I wanted now! Thanks for your help!

    October 29, 2014 at 4:11 pm #129814
    JamesRoberts
    Member

    Great, no problem Greg, glad it is working 🙂


    Need beautiful and responsive Genesis child themes at amazing prices? Stop by LlamaPress and check out our themes.

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