Widgetized page

Community Forums Forums Design Tips and Tricks Widgetized page

This topic is: not resolved

Tagged: ,

This topic contains 12 replies, has 2 voices, and was last updated by  masonjarsalads 6 months, 2 weeks ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #83718

    masonjarsalads
    Member
    Post count: 99

    Hi again, I am trying to make an image index for the recipes page using the categories I’ve set up. I believe I’ve followed these instructions to a tee but I am missing something because I can’t find the widgets. Would someone mind taking a look?

    http://journalxtra.com/easyguides/how-to-create-genesis-page-template-widgets/

    Here’s the template…

    <?php /*
    Template Name: Recipe Template
    */ ?>

    <?php

    add_action( ‘genesis_meta’, ‘sample_theme_recipe_template_genesis_meta’ );
    /**
    * Add widget support for this template. If no widgets are active, display the default Genesis loop.
    *
    */

    function sample_theme_recipe_template_genesis_meta() {

    if ( is_active_sidebar( ‘recipe-template-category-one’ ) || is_active_sidebar( ‘recipe-template-category-two’ ) ) {

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘sample_theme_recipe_template_category_one’ );
    add_action( ‘genesis_loop’, ‘sample_theme_recipe_template_category_two’ );
    add_filter( ‘body_class’, ‘add_body_class’ );

    function add_body_class( $classes ) {
    $classes[] = ‘sample-theme-recipe-template’;
    return $classes;
    }

    }
    }

    function sample_theme_recipe_template_category_one() {

    if ( is_active_sidebar( ‘recipe-template-category-one’ ) ) {
    genesis_widget_area( ‘recipe-template-category-one’, array(
    ‘before’ => ‘<div class=”recipe-template-category-one widget-area”>’,
    ) );
    }

    }

    function sample_theme_recipe_template_category_two() {

    if ( is_active_sidebar( ‘recipe-template-category-two’ ) ) {
    genesis_widget_area( ‘recipe-template-category-two’, array(
    ‘before’ => ‘<div class=”recipe-template-category-two widget-area”>’,
    ) );
    }

    }

    genesis();

    And here is what I’ve added to the function.php – maybe I didn’t correctly identify the widets?

    //* Register Widget Area
    genesis_register_sidebar( array(
    ‘id’ => ‘recipe-template-category-one’,
    ‘name’ => __( ‘Widget Name as it shows in Appearance>Widgets’, ‘sample-theme’ ),
    ‘description’ => __( ‘Description of your widget as it appears in Appearance>Widgets.’, ‘sample-theme’ ),
    ) );

    Thanks, I’ve been trying to figure this out for a very long time.

    http://www.masonjarsalads.com
    #83723

    braddalton
    Participant
    Post count: 8873

    Can’t test that code because you embedded it in a web page. Please paste the code from the file into a Gist and embed the Gist here thanks,

    I did notice you’ve only registered one new widget.

    Also, the code used in that tutorial isn’t good for HTML 5 themes.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #83725

    masonjarsalads
    Member
    Post count: 99

    Thanks,

    #83728

    masonjarsalads
    Member
    Post count: 99

    I’m trying to include the link to the gist here but it isn’t working. I didn’t realize that tutorial isn’t good for HTML 5 themes I found it to be the most popularly recommended. Might you suggest a better way to create a photo index for recipes? I prefer not to use a plug-in if I can code it myself.

    I’m using the sample theme.

    Thanks for your help!

    #83805

    braddalton
    Participant
    Post count: 8873

    Personally, i would either create a custom post type with support for creating custom taxonomy types and use a portfolio style archive page.

    The Executive theme includes all the best code for this. http://my.studiopress.com/themes/executive/

    Or, create a widgetized custom page template which you can simply populate with widgets. http://wpsites.net/web-design/flexible-responsive-widgets-template-for-genesis/

    Or you could add the Agency Pro’s front page to the Sample theme http://wpsites.net/web-design/custom-portfolio-template-with-hover-effects-using-genesis-featured-posts-widget/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #83810

    masonjarsalads
    Member
    Post count: 99

    Thanks Brad, I really appreciate it. I will check out your suggestions.

    #83861

    masonjarsalads
    Member
    Post count: 99

    I followed your tutorial for a widgetized custom page template. How can I populate a specific page with widgets? I set the template to “widgets template” but I can’t seem to find the widgets. The only place that I can use them are on the home page.

    Thanks again.

    #83920

    braddalton
    Participant
    Post count: 8873

    You can use on any page. Populate the new widgets and then select the template from any page. You can then choose that page as your front page.

    The code to register the widgets goes in your functions file.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #83936

    masonjarsalads
    Member
    Post count: 99

    Sorry, I’m still new at this so bear with me. How do I populate the new widgets? I’ve registered them in my functions.php file. I can see the new template as an option but it looks just like any other page.

    #84317

    braddalton
    Participant
    Post count: 8873

    Go to Appearance > Widgets and drag in a few widgets


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #84477

    masonjarsalads
    Member
    Post count: 99

    I am clearly missing something, when I got to appearance>widgets it only affects the home page.

    #84489

    braddalton
    Participant
    Post count: 8873

    Yes because its a template. How many pages did you want it to effect?

    Otherwise you’ll need to use a portfolio style archive which effects all your category archives.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #84495

    masonjarsalads
    Member
    Post count: 99

    I’m looking for something like this

    http://www.framedcooks.com/recipe-index

    on two pages.

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

You must be logged in to reply to this topic.