• 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

New blog page template to override the default blog template?

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 › New blog page template to override the default blog template?

This topic is: resolved

Tagged: blog page, blog template, posts page

  • This topic has 6 replies, 2 voices, and was last updated 3 years, 4 months ago by Stela.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • July 17, 2020 at 3:09 am #500147
    Stela
    Participant

    Hello,

    I am trying to create a new template for the Blog page, so I can customize it but the Blog page is not taking the new template.

    I created a file page_blog.php in the child theme directory with the following contents to test the template:

    <?php
    
    //* Template Name: Blog
    
    add_action( 'genesis_before_entry_content', 'theme_prefix_show_notice' );
    function theme_prefix_show_notice() {
    	echo '<p class="notice">This page has a override blog template page_blog</p>';
    }
    genesis();

    I also set the new template in the page settings but still it is not working.

    How can I fix this?
    Thank you!

    July 17, 2020 at 3:27 am #500148
    Brad Dalton
    Participant

    Try this solution


    Tutorials for StudioPress Themes.

    July 17, 2020 at 4:35 am #500149
    Stela
    Participant

    Hi Brad,
    Thank you for the reply but this is not the solution for me.
    I would like to assign new template page_blog.php to the default Blog page and add my customizations there.

    Is there a way to this?

    I am following the instructions from here:
    https://my.studiopress.com/documentation/snippets/miscellaneous/show-content-above-posts-on-blog-page/

    however the default Blog page doesn't take the new template page_blog.php (even if i select -Blog- from the Template dropdown in the Page Attributes meta box)

    July 17, 2020 at 4:46 am #500151
    Brad Dalton
    Participant

    That's because they removed the template from Genesis. What you can do now is set the posts page in Reading settings and use any template for that page.


    Tutorials for StudioPress Themes.

    July 17, 2020 at 8:34 am #500153
    Stela
    Participant

    Ok, i created new page and assigned my new blog template page_blog.php for it (in Page Attribute Template dropdown).
    However, once i set this page in Reading settings as 'Posts page', it turns back using the the default blog template at the front-end.

    Does this mean that i can not have a blog template for my customizations and have to use functions.php for all the modifications?

    ...or I am doing something not correct?

    July 17, 2020 at 8:39 am #500154
    Brad Dalton
    Participant

    Try this code to load your template on your posts page.


    Tutorials for StudioPress Themes.

    July 18, 2020 at 5:32 am #500171
    Stela
    Participant

    Perfect!!! It is working now.

    Thank you so so much, Brad 🙂

    For documentation, in case someone need it, in Brad's code above, I replaced is_singular('page') with is_home('page') || is_archive('page'), so the new custom blog template is applied to all blog type pages.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘New blog page template to override the default blog template?’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

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