• 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

Include after_entry widget area in the site-container structural 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 › Include after_entry widget area in the site-container structural area

This topic is: not resolved

Tagged: After Entry, container, genesis_structural_wrap, wrap

  • This topic has 1 reply, 1 voice, and was last updated 7 years, 11 months ago by EZEarache.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 14, 2015 at 9:04 pm #147958
    EZEarache
    Member

    Hi,

    I am trying to get two custom widget areas to wrap in the site-container so they align next to each other.

    I just discovered the genesis_structural_wrap function.

    I'm using the following code on my site, but it wraps them in separate containers. How do I get them in the same container?

    //* Add support for structural wraps so that widget areas can be placed into the home page 
    add_theme_support( 'genesis-structural-wraps', array(
    	'header',
    	'nav',
    	'subnav',
    	'site-inner',
    	'footer-widgets',
    	'footer',
    	'events-widget',
    	'contact-widget'
    ) );
    
    //* Contact Widget
    genesis_register_sidebar( array(
    'id' => 'contact-widget',
    'name' => __( 'Contact Widget', 'genesis' ),
    'description' => __( 'Contains Contact Information under the Content Area' ),
    ) );
    
    add_action( 'genesis_after_entry', 'add_genesis_widget_area' );
    function add_genesis_widget_area() {
    if ( is_page('006') && is_active_sidebar('contact-widget') ) {
    genesis_structural_wrap( 'contact-widget' );//Puts the Event's Widget in the container
    genesis_widget_area( 'contact-widget', array(
    'before' => '<div id="contact-widget">',
    'after' => '</div>',
    ) );
    genesis_structural_wrap( 'contact-widget', 'close' );
    }
    }
    
    //* Events Widget
    genesis_register_sidebar( array(
    'id' => 'events-widget',
    'name' => __( 'Events Widget for Home Page', 'genesis' ),
    'description' => __( 'Contains Events Widget under the Content Area' ),
    ) );
    
    add_action( 'genesis_after_entry', 'add_genesis_events_widget' );
    function add_genesis_events_widget() {
    if ( is_page('006') && is_active_sidebar('events-widget') ) {
    genesis_structural_wrap( 'events-widget' );//Puts the Event's Widget in the container
    genesis_widget_area( 'events-widget', array(
    'before' => '<div id="events-widget">',
    'after' => '</div><div class="clear-widget"></div>',//* Ends Home Widget Container
    ) );
    genesis_structural_wrap( 'events-widget', 'close' );
    }
    }
    http://kayakwappingers.com/awayadventures/
    April 16, 2015 at 6:44 pm #148166
    EZEarache
    Member

    O.K. So this is resolved.

    The proper way to do this is not so much with a Genesis Structural Wrap as I originally thought. The correct way to do this is with an echo function which then wraps the two widget areas in your functions.php file like so:

    //* Contact Widget
    genesis_register_sidebar( array(
    	'id' => 'contact-widget',
    	'name' => __( 'Contact Widget', 'genesis' ),
    	'description' => __( 'Contains Contact Information under the Content Area' ),
    ) );
    
    //* Events Widget
    genesis_register_sidebar( array(
    	'id' => 'events-widget',
    	'name' => __( 'Events Widget for Home Page', 'genesis' ),
    	'description' => __( 'Contains Events Widget under the Content Area' ),
    ) );
    
    add_action( 'genesis_after_entry', 'add_genesis_widget_area' );
    function add_genesis_widget_area() {
    	if ( is_page('006') && is_active_sidebar('contact-widget') ) {
    		
    		echo '<div class="two-widget-container">';  //This Opens the widget-container
    		genesis_widget_area( 'contact-widget', array(
    			'before' => '<div class="contact-widget-wrapper one-half first">',
    			'after' => '</div>',
    		) );
    
    		genesis_widget_area( 'events-widget', array(
    			'before' => '<div class="events-widget-wrapper one-half">',
    			'after' => '</div>',// Ends Home Widget Container
    		) );
    		
    		echo '</div>'; //Closes the widget-container
    		
    	}
    }

    I would like to thank Sure Fire Web for showing me the light here. Now I understand echo Whoop Whoop!

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