Custom Page Template using grid loop metric theme

Community Forums Forums Design Tips and Tricks Custom Page Template using grid loop metric theme

This topic is: not resolved

This topic contains 5 replies, has 3 voices, and was last updated by  krystyn 1 year, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #19293

    charriott4
    Participant
    Post count: 60

    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

    #21410

    cdils
    Participant
    Post count: 421

    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 Genesis-focused podcast called Genesis Office Hours. I tweet @cdils.

    #21847

    krystyn
    Participant
    Post count: 148

    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?

    #21852

    charriott4
    Participant
    Post count: 60

    Yes Krystyn, just about :)


    Web Designs By Chrissy | Twitter @designbychrissy

    Follow Me On Facebook

    #21853

    krystyn
    Participant
    Post count: 148

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

    #21856

    krystyn
    Participant
    Post count: 148

    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();

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.