• 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

show page content custom home 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 › show page content custom home template

This topic is: not resolved
  • This topic has 6 replies, 3 voices, and was last updated 12 years, 3 months ago by Brad Dalton.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • November 25, 2013 at 9:05 pm #75624
    dmcleod87
    Member

    hi all,

    i have started building a new site and i'm having trouble with a custom home template i've created. i've put it together from various sources. the code i used below displays the homepage content, but also displays all the websites pages as posts below the page content.

    
    add_action('genesis_loop', 'custom_loop');
    function custom_loop() {
    	global $paged;
     
        $args = array('post_type' => 'page');
        // Accepts WP_Query args
        // (http://codex.wordpress.org/Class_Reference/WP_Query)
        
        genesis_custom_loop( $args );
    
    }
    

    i've tried adding this query but it seems to do nothing

    
    $query = new WP_Query( 'page_id=31' );
    

    can anyone point me in the right direction? thanks!

    http://grayking.dylanmcleod.net.au/
    November 25, 2013 at 11:26 pm #75646
    Summer
    Member

    What happens when you scrap that template and just set that particular page to be your static front page in Settings > Reading?

    Seems that might be the easier course of action, unless there's something else you were trying to achieve?


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    November 25, 2013 at 11:35 pm #75647
    dmcleod87
    Member

    that's what it's set to currently, but still shows the other pages as posts...all i want is the homepage content which is there, but without the other page content underneath...

    November 26, 2013 at 7:36 am #75681
    Brad Dalton
    Participant

    What theme are you using?

    You could use a custom page template with widgets so the loop of posts is not displayed.


    Tutorials for StudioPress Themes.

    November 26, 2013 at 3:06 pm #75750
    dmcleod87
    Member

    i'm using the genesis sample theme with a custom template and widgets, but need to show page content as well. full code for template is below -

    <?php
    /*
    Template Name: Widget Template

    Created for three featured widget section, by Iniyan-tweaky
    */
    //Displaying posts on this page
    remove_action( 'genesis_loop', 'genesis_do_loop' );

    add_action('genesis_loop', 'custom_loop');
    function custom_loop() {
    global $paged;

    $args = array('post_type' => 'page');
    // Accepts WP_Query args
    // (http://codex.wordpress.org/Class_Reference/WP_Query)

    // $query = new WP_Query( 'page_id=31' );

    genesis_custom_loop( $args );

    }

    //Featured Widgets
    add_action('genesis_before_content', 'iniyan_template');
    function iniyan_template() {

    echo'<div id="tweaky-widgets">';

    genesis_widget_area( 'home-featured', array(
    'before' => '<div class="home-featured widget-area">',
    'after' => '</div>',
    ) );

    genesis_widget_area( 'featured-one', array(
    'before' => '<div class="featured-one">',
    'after' => '</div>',
    ) );

    genesis_widget_area( 'featured-two', array(
    'before' => '<div class="featured-two">',
    'after' => '</div>',
    ) );

    genesis_widget_area( 'featured-three', array(
    'before' => '<div class="featured-three">',
    'after' => '</div>',
    ) );

    echo '</div>';

    }

    genesis(); // <- everything important: make sure to include this.

    November 26, 2013 at 4:15 pm #75763
    dmcleod87
    Member

    nevermind figured it out. just had to remove custom loop and leave the widgets.

    
    <?php
    /* 
    Template Name: Widget Template
    */
    
    //Featured Widgets
    add_action('genesis_before_content', 'iniyan_template');
    function iniyan_template() {
    
    echo'<div id="tweaky-widgets">';
    
    genesis_widget_area( 'home-featured', array(
        	'before' => '<div class="home-featured widget-area">',
        	'after' => '</div>',
    ) );
    
    genesis_widget_area( 'featured-one', array(
           'before' => '<div class="featured-one">',
           'after' => '</div>',
       ) );
       
    
    genesis_widget_area( 'featured-two', array(
           'before' => '<div class="featured-two">',
           'after' => '</div>',
       ) );
       
    
    genesis_widget_area( 'featured-three', array(
           'before' => '<div class="featured-three">',
           'after' => '</div>',
       ) );
    
    echo '</div>';
    
    }
    
    genesis(); // <- everything important: make sure to include this. 
    
    November 27, 2013 at 2:23 am #75821
    Brad Dalton
    Participant

    Don't think that will work as you register widgets in your child themes functions file not a template file.


    Tutorials for StudioPress Themes.

  • 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

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