• 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

Education Pro new widget area

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 › Education Pro new widget area

This topic is: resolved

Tagged: education pro, New Widget Area

  • This topic has 4 replies, 2 voices, and was last updated 8 years, 7 months ago by Tim Squires.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 2, 2015 at 5:17 am #139369
    Tim Squires
    Member

    Hi,
    I have created a new widget area in the Education Pro theme.

    The nearest hook to where I need it to be seems to be 'after-header'

    But I need it to appear on the front page between the home top widget area and the home middle widget area.

    I have placed a calendar in the widget area that I have created so you can see it easily.

    The code that I placed in functions.php is this:

    //* Register after header widget area
    genesis_register_sidebar( array(
    'id' => 'after-header',
    'name' => __( 'After Header', 'education' ),
    'description' => __( 'This is the after header widget area.', 'education' ),
    ) );
    
    //* Hook after header widget area before content
    add_action( 'genesis_after_header', 'bg_after_header_widget_area' );
    function bg_after_header_widget_area() {
    genesis_widget_area( 'after-header', array(
    'before' => '<div class="after-header widget-area"><div class="wrap">',
    'after' => '</div></div>',
    ) );
    } 

    Does anyone know how to make my new widget area display between home top and home middle? Is there a hook that I have missed?

    Many thanks,
    Tim

    My site is here;
    http://www.timsquires.com.au/sandbox/


    timsquires.com.au

    http://www.timsquires.com.au/sandbox/
    February 2, 2015 at 7:35 am #139386
    Carlo
    Member

    Hi Tim. Remove the hook from your theme functions and move the call to genesis_widget_area into the template front-page.php, between the calls to genesis_widget_area for 'home-top and 'home-middle' (I think it's line 63?)


    Comprehensive, easy to follow Genesis documentation

    February 2, 2015 at 4:39 pm #139452
    Tim Squires
    Member

    Hi Carlo,
    Thanks for your reply.

    I've found the correct place to place the code in frontpage.php, but I must be pasting the wrong code as it isn't working.

    Do I remove the whole block of code from functions.php, or just a section of it? (sorry, I'm not sure of the difference between the 'hook' and the 'call')

    I've tried a few combinations, but no luck.

    Many thanks for your help!
    Tim


    timsquires.com.au

    February 3, 2015 at 4:19 am #139496
    Tim Squires
    Member

    Hi again Carlo,
    Thanks for your help — I've figured it out now and it works perfectly.

    For anyone following, in my functions.php I have this;

    //* Register after header widget area
    genesis_register_sidebar( array(
    'id' => 'after-header',
    'name' => __( 'After Header', 'education' ),
    'description' => __( 'This is the after header widget area.', 'education' ),
    ) );

    ...and in my front-page.php I have this:

    function education_home_top_widgets() {
    
    	genesis_widget_area( 'home-featured', array(
    		'before' => '<div class="home-featured widget-area">',
    		'after'  => '</div>',
    	) );
    	
    	genesis_widget_area( 'home-top', array(
    		'before' => '<div class="home-top widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    	
    	genesis_widget_area( 'after-header', array(
            'before' => '<div class="after-header widget-area"><div class="wrap">',
            'after' => '</div></div>',
        ) );
    	
    	genesis_widget_area( 'home-middle', array(
    		'before' => '<div class="home-middle widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    }

    Thanks again, Carlo
    Tim


    timsquires.com.au

    February 3, 2015 at 4:22 am #139497
    Tim Squires
    Member

    PS: Just noticed that my indents are a bit sloppy, and I will change the name of the widget to better reflect where it appears on the page. But at least it's working 🙂
    Tim


    timsquires.com.au

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