• 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

How do you create a generic template page for eleven40?

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 › How do you create a generic template page for eleven40?

This topic is: not resolved

Tagged: custom template page, Eleven40

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 9 months ago by ramseyp.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 6, 2013 at 8:18 am #33466
    Chris Moore
    Member

    Hello,

    I am trying to create a customized template page to use as a drop-down option in the Page Attributes section (after adding a page).

    I got the page working with this much so far, but much is missing:

    /*
    Template Name: Thank You Page - Email
    */
    get_header();
    get_sidebar();
    get_sidebar( $name = alt );
    get_footer();

    I would like to fill in the gaps in the code so that I have a fully formed and structured page, just like a 3-column page in the eleven40 child theme (exactly like this page: http://demo.studiopress.com/eleven40/sample/sub-page-11/)

    I would also like to have one last thing: I would like to have a loop that displays the last 5 posts of the blog in the middle of the content area of the page.

    Thanks!


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    April 6, 2013 at 8:58 am #33469
    ramseyp
    Member

    Hi there,

    First thing you need to do is redo the code you have in the template. Since you're using a Genesis child theme, the page template needs to become part of the Genesis environment. Redo you template to read like this:


    <?php
    /**
    * Template Name: Thank You Page - Email
    *
    */

    genesis();

    That right there will make it a working page template and make it part of the genesis environment.

    The second part you mention would involve replacing the standard post content functionality with a custom loop. With Genesis, you add or remove actions (functions) to manipulate the output. If you're not familiar with Nick's Genesis Framework overview, start here.

    You would want this in your page template, before the genesis(); bit:

    remove_action( 'genesis_loop','genesis_do_loop' );

    This unhooks the default loop of that page so you can replace it with a custom one that grabs the 5 posts:

    add_action( 'genesis_loop','my_custom_loop' );

    Now we replace genesis_do_loop with our own function, my_custom_loop where the custom loop will go. We have to create this function before it can do anything.

    function my_custom_loop() {

    }

    Between these brackets, { and }, we write what the function should do. You want the 5 latest Posts, so something like this would work:

    function my_custom_content() {
    $args = array(
    'posts_per_page' => 5,
    'post_status' => 'publish',
    );
    genesis_custom_loop( $args );
    }

    The finished page template would look something like:


    5,
    'post_status' => 'publish',
    );
    genesis_custom_loop( $args );
    }

    remove_action( 'genesis_loop','genesis_do_loop' );
    add_action( 'genesis_loop','my_custom_loop' );

    genesis();


    Community • Work • Conversations

    April 6, 2013 at 9:53 am #33482
    Chris Moore
    Member

    I'm sorry, things didn't come out too clearly, I think because of the way code is handled in the forums here... Are you saying this:

    remove_action( 'genesis_loop','genesis_do_loop' );
    add_action( 'genesis_loop','my_custom_loop' );

    function my_custom_loop() {
    function my_custom_content() {
    $args = array(
    'posts_per_page' => 5,
    'post_status' => 'publish',
    );
    genesis_custom_loop( $args );
    }
    }
    genesis();


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    April 6, 2013 at 11:01 am #33498
    ramseyp
    Member

    Apologies, the page template should contain ( besides the opening php tag and the comment block with the template name in it):


    remove_action( 'genesis_loop','genesis_do_loop' );
    add_action( 'genesis_loop','my_custom_loop' );
    function my_custom_loop() {
    $args = array(
    'posts_per_page' => 5,
    'post_status' => 'publish',
    );
    genesis_custom_loop( $args );
    }
    genesis();


    Community • Work • Conversations

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