• 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

Hook Code Not Working

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 › Hook Code Not Working

This topic is: resolved

Tagged: genesis, hooks

  • This topic has 5 replies, 3 voices, and was last updated 12 years, 1 month ago by Tonya.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • September 9, 2014 at 10:00 pm #123687
    kolbigray
    Member

    Hey there! I tried to add a hook on my page. Once I added the hook, I went to my widgets area to place some things in the hook. When I went to see if the widget showed up, it didn't. I moved the widget to multiple hook areas and still nothing showed up. Am I missing something in my code? Or is this a website problem?

    Here is the code I used.

    genesis_register_sidebar( array(
    'id' => 'featured-posts',
    'name' => __( 'Featured Post Slider', 'genesis' ),
    'description' => __( 'This is where the slider for the featured posts goes', 'childtheme' ),
    ) );
    
    add_action( 'genesis_before_content', 'add_genesis_widget_area' );
    function add_genesis_widget_area() {
                    genesis_widget_area( 'custom-widget', array(
    		'before' => '<div class="custom-widget widget-area">',
    		'after'  => '</div>',
        ) );
    
    }

    This widget was supposed to go show up in the genesis_before_entry but that didn't work so I tried a few more areas and the "genesis_before_content" was the last area I tried. No luck.

    Basically what was going in this widget was a slider and a title for the slider.

    I appreciate any and all help in advance!

    http://http//www.kolbigray.com
    September 10, 2014 at 1:38 am #123693
    Tonya
    Member

    Hi,

    In the hook genesis_widget_area, the first arg needs to be the widget's ID from when you registered it, i.e. 'featured-posts'.

    Cheers,
    Tonya


    Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
    Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer Bootcamp

    September 10, 2014 at 6:33 am #123723
    Brad Dalton
    Participant

    @kolbigray Is this where the code comes from? http://wpsites.net/web-design/widget-genesis/


    Tutorials for StudioPress Themes.

    September 10, 2014 at 10:15 am #123753
    kolbigray
    Member

    @Braddalton - Yep! That's where the code came from. You explained it way better than I saw it explained in the Studiopress member area. I guess I was missing a minor thing.

    @Tonya! Thanks so much! I'm going to try this code right now! I'll let you know how it goes!

    September 10, 2014 at 10:41 am #123760
    kolbigray
    Member

    @Tanya That worked! Thanks so much! You all have been so helpful!

    September 10, 2014 at 10:44 am #123761
    Tonya
    Member

    You're very welcome. 🙂

    Enjoy your day


    Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
    Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer Bootcamp

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

© 2026 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