• 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 Page Template using grid loop metric theme

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 Page Template using grid loop metric theme

This topic is: not resolved
  • This topic has 5 replies, 3 voices, and was last updated 10 years, 9 months ago by krystyn.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 9, 2013 at 4:16 pm #19293
    charriott4
    Member

    Im trying to create a custom blog page template using the grid loop but nothing is working?

    http://quench-essential.com/ingredients/

     

    <?php
    /**
    * Template Name: Blog
    */

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'child_grid_loop_helper' );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {
    if ( function_exists( 'genesis_grid_loop' ) ) {
    genesis_grid_loop( array(
    'features' => 2,
    'feature_image_size' => 0,
    'feature_image_class' => 'alignleft post-image',
    'feature_content_limit' => 0,
    'grid_image_size' => 'grid-thumbnail',
    'grid_image_class' => 'alignleft post-image',
    'grid_content_limit' => 0,
    'more' => __( '[Continue reading...]', 'genesis' ),
    'posts_per_page' => 6,
    'cat' => '6,7' //enter your category IDs here separated by commas in ' '
    ) );
    } else {
    genesis_standard_loop();
    }
    }

    /** Remove the post meta function for front page only **/
    remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
    genesis();


    Web Designs By Chrissy | Twitter @designbychrissy

    Follow Me On Facebook

    February 19, 2013 at 1:42 pm #21410
    cdils
    Participant

    I don't think the Metric theme uses the grid loop. Does it? If not, you'll need to include the function, before you can call it.

    So this line if ( function_exists( ‘genesis_grid_loop’ ) ) will return false because the function doesn't exist.

    If you don't want to install the grid loop code manually (http://www.billerickson.net/a-better-and-easier-grid-loop/), you could try using the Genesis Grid Loop plugin. Might save you creating/using a custom template altogether. 🙂

    Carrie


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂

    I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.

    February 20, 2013 at 7:29 pm #21847
    krystyn
    Participant

    I'm soooo glad I found this post. Which of the theme use the grid loop? Is there a good way to find this out?

    I'm assuming this same code would work for any template I would want to create? Like a custom category page?

    February 20, 2013 at 7:52 pm #21852
    charriott4
    Member

    Yes Krystyn, just about 🙂


    Web Designs By Chrissy | Twitter @designbychrissy

    Follow Me On Facebook

    February 20, 2013 at 7:58 pm #21853
    krystyn
    Participant

    I guess it's time to learn how to create a custom template. Thanks.

    February 20, 2013 at 8:19 pm #21856
    krystyn
    Participant

    Hmmmm...I added a template and used it on a page.

    I think I got all of the smart quotes from copying it, but I'm getting an error when I try to view the page.

    Any glaring issues?

    <?php
    /**
    * Template Name: Categories
    */

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'child_grid_loop_helper' );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {
    if ( function_exists( 'genesis_grid_loop' ) ) {
    genesis_grid_loop( array(
    'features' => 2,
    'feature_image_size' => 0,
    'feature_image_class' => 'alignleft post-image',
    'feature_content_limit' => 0,
    'grid_image_size' => 'grid-thumbnail',
    'grid_image_class' => 'alignleft post-image',
    'grid_content_limit' => 0,
    'more' => __( '[Continue reading...]', 'genesis' ),
    'posts_per_page' => 6,
    'cat => '1' //enter your category IDs here separated by commas in ' '
    ) );
    } else {
    genesis_standard_loop();
    }
    }

    /** Remove the post meta function for front page only **/
    remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
    genesis();

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

© 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