• 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 Page Template that allows for Widgets

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 Page Template that allows for Widgets

This topic is: not resolved

Tagged: page layout, pate template

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 3 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 11, 2013 at 7:25 pm #62037
    tlc72
    Member

    I'm trying to create a new Page that acts like a Home Page. Where I can use widgets for the layout. Here is what I have done thus far:
    1. Created a new file through my webhost in the same folder that has my Child Theme (Magazine)
    2. Named that file: pages_motm.php
    3. Went to my dashboard -> editor-> pages_motm.php
    4. Pasted the below code (same code as Home.php, but all references to "home" have been changed to "motm") and saved.

    Questions:
    1. Is this the correct way to code the new page template?
    2. When I created a Page and chose the MOTM template..... its no different than any other page I create. So, either the below code is incorrect or I have no idea how to access the new template to lay out the widgets. Yes.. I'm a total novice!

    Any help is appreciated!
    Thanks!
    Tammy

    <?php
    /*
     Template Name: MOTM Page
     */
    <?php
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'magazine_motm_loop_helper' );
    /**
    * Add widget support for homepage. If no widgets active, display the default loop.
    *
    */
    function magazine_home_loop_helper() {

    if ( is_active_sidebar( 'motm-top' ) || is_active_sidebar( 'motm-left' ) || is_active_sidebar( 'motm-right' ) || is_active_sidebar( 'motm-bottom' ) ) {

    if ( is_active_sidebar( 'motm-top' ) ) {
    echo '<div class="motm-top">';
    dynamic_sidebar( 'motm-top' );
    echo '</div><!-- end .motm-top -->';
    }

    if ( is_active_sidebar( 'motm-left' ) || is_active_sidebar( 'motm-right' ) ) {

    echo '<div class="motm-middle">';

    if ( is_active_sidebar( 'motm-left' ) ) {
    echo '<div class="motm-left">';
    dynamic_sidebar( 'motm-left' );
    echo '</div><!-- end .motm-left -->';
    }

    if ( is_active_sidebar( 'motm-right' ) ) {
    echo '<div class="motm-right">';
    dynamic_sidebar( 'motm-right' );
    echo '</div><!-- end .motm-right -->';
    }

    echo '</div><!-- end .motm-middle -->';

    }

    if ( is_active_sidebar( 'motm-bottom' ) ) {
    echo '<div class="motm-bottom">';
    dynamic_sidebar( 'motm-bottom' );
    echo '</div><!-- end .motm-bottom -->';
    }

    }

    else {
    genesis_standard_loop();
    }

    }

    genesis();

    September 12, 2013 at 12:03 am #62058
    Brad Dalton
    Participant

    Try this http://wpsites.net/web-design/create-custom-page-template-like-home-for-the-agency-theme/

    And you may also be interested in this http://wpsites.net/wordpress-themes/new-magazine-pro-theme-by-studiopress-sneak-peak/


    Tutorials for StudioPress Themes.

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