• 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

Action Hook Not Showing

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 › Action Hook Not Showing

This topic is: resolved

Tagged: action hooks, adding widget, outreach, Outreach Pro

  • This topic has 6 replies, 2 voices, and was last updated 5 years, 8 months ago by kathyosborne.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • May 19, 2017 at 11:20 am #206708
    kathyosborne
    Participant

    I'm working in the Outreach theme. I need to add two more widgets to the home page.

    Below the slider you can see the four widget sections showing. I need a widget above and below it. The one below it is showing, but the one above isn't.

    I used the same code and just changed the hook...

    This is the code I'm using for the Specials area that *is* working

    
    //Add Specials Area
    function genesischild_specials() {
    	genesis_register_sidebar( array(
    	'id' => 'specials',
    	'name' => __( 'Specials Section', 'genesis' ),
    	'description' => __( 'This is for the specials section on home page', 'genesis' ),
    	) );
    
    }
    
    add_action ('widgets_init','genesischild_specials');
    
    //Position Specials Area
    function genesischild_specials_position ()  {
    	echo '<div class="specials-container"><div class="wrap">';
    	genesis_widget_area ('specials');
    	echo '</div></div>';
    
    }
    
    add_action ('genesis_after_home-bottom_widget_area','genesischild_specials_position');

    Here is the code that *is not* working

    //Add Description Widget Area
    function genesischild_description() {
    	genesis_register_sidebar( array(
    	'id' => 'description',
    	'name' => __( 'Description Section', 'genesis' ),
    	'description' => __( 'This is for the description section on home page', 'genesis' ),
    	) );
    
    }
    
    add_action ('widgets_init','genesischild_description');
    
    //Position Description Widget Area
    function genesischild_description_position ()  {
    	echo '<div class="description-container"><div class="wrap">';
    	genesis_widget_area ('description');
    	echo '</div></div>';
    
    }
    
    add_action ('genesis_before_home-bottom_widget_area','genesischild_description', 5);

    Not sure what I'm doing wrong.... ???

    http://wordpress.sprfc.com/
    May 19, 2017 at 11:54 am #206712
    kathyosborne
    Participant

    In addition, how can I make these areas 100% in width> not the 4 columns... ?

    May 19, 2017 at 4:47 pm #206715
    Victor Font
    Moderator

    It's most likely due to the priority of 5 you gave the code that's not working. Your specials area is not really placing the specials area after the home-bottom widget area. It's placing it within the home-bottom widget area. I wouldn't have used the add actions to place the widget areas either. I would have just modified front-page.php directly which is probably using the default priority of 10 to create home-bottom.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 20, 2017 at 6:12 am #206738
    Victor Font
    Moderator

    As I was thinking more on this, where did you find the action hooks you are using documented? These hooks are not found in Genesis, nor are they dynamically generated by any of the genesis dynamic functions. Every add_action requires a corresponding do_action. You can always create your own hooks, but where did you include the do_actions for your hooks?


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 22, 2017 at 5:42 am #206827
    kathyosborne
    Participant

    Hi Victor!

    When I was trying to figure out why, I took a look at the home page and didn't really see a clear way for me to do it. I'm still early in the hook/action learning process so I didn't want to break anything.

    I was using the Genesis Visual Hook Guide plugin and to add it in along with this tutorial as a guide: https://wpbeaches.com/add-full-width-row-footer-widgets-genesis-child-theme/

    The 5 was just an attempt to get it to show, but it didn't work with or without it.

    I'm still new to action hooks so what I'm doing might not make sense :0

    Is there a good resource for me to learn about editing the front-page.php?

    thanks so much,
    kathy

    May 22, 2017 at 6:01 am #206828
    Victor Font
    Moderator

    First, get rid of all the code you added. In Outreach Pro, at the bottom of front-page.php, you'll find this function:

    function outreach_home_bottom_widgets() {
    
    	genesis_widget_area( 'home-bottom', array(
    		'before' => '<div class="home-bottom widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    }

    Modify this function as so:

    function outreach_home_bottom_widgets() {
    
    	genesis_widget_area( 'before-home-bottom', array(
    		'before' => '<div class="before-home-bottom widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    	genesis_widget_area( 'home-bottom', array(
    		'before' => '<div class="home-bottom widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    	genesis_widget_area( 'after-home-bottom', array(
    		'before' => '<div class="after-home-bottom widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    }

    In functions.php, you add:

    genesis_register_sidebar( array(
    	'id'          => 'before-home-bottom',
    	'name'        => __( 'Before Home Bottom', 'outreach' ),
    	'description' => __( 'This is the before home bottom widget area.', 'outreach' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'after-home-bottom',
    	'name'        => __( 'After Home Bottom', 'outreach' ),
    	'description' => __( 'This is the after home bottom widget area.', 'outreach' ),
    ) );

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 23, 2017 at 3:30 am #206854
    kathyosborne
    Participant

    Worked perfect! Thank you so much of your help.
    Kathy

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Action Hook Not Showing’ is closed to new 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