• 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 not working right

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 not working right

This topic is: not resolved
  • This topic has 6 replies, 2 voices, and was last updated 11 years, 4 months ago by patrick24601.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • January 12, 2014 at 3:14 pm #84826
    patrick24601
    Member

    This may or may not be a Genesis issue. It may be Genesis Simple Hooks. But I thought I'd ask.

    I'm using Genesis simple hooks to execute a shortcode at a genesis_before_content_sidebar_wrap hook. The shortcode works just fine when viewing a single post. But not when viewing the blog home page i.e. in the loop (I think). You can see it at http://stopdoingnothing.com . You'll see the shortcode right now. But click on an individual blog post and it works OK.

    Any ideas? Is there a better way to do this?

    Thanks. Patrick

    http://stopdoingnothing.com
    January 12, 2014 at 3:42 pm #84830
    Brad Dalton
    Participant

    You can hook in in using a custom function rather than simple hooks:

    function wpsites_before_content_shortcode() {
    echo do_shortcode('[hcshort id="16"]');
       }
    }
    add_action('genesis_before_content_sidebar_wrap', 'wpsites_before_content_shortcode');
    

    Tutorials for StudioPress Themes.

    January 12, 2014 at 5:11 pm #84846
    patrick24601
    Member

    Will that solve the problem of it not getting interpreted on the home page?

    January 12, 2014 at 5:27 pm #84851
    patrick24601
    Member

    I tried your solution. All it did was put the shortcode text up there again. It is like shortcodes are being ignored in that area.

    Any idea why?

    January 12, 2014 at 6:44 pm #84864
    Brad Dalton
    Participant

    Sorry. The code should be:

    function wpsites_before_content_shortcode() {
    echo do_shortcode('[hcshort id="16"]');
       }
    add_action('genesis_before_content_sidebar_wrap', 'wpsites_before_content_shortcode');
    

    Tutorials for StudioPress Themes.

    January 12, 2014 at 6:48 pm #84865
    patrick24601
    Member

    I appreciate the help, but getting same result. You can see it at the top of http://stopdoingnothing.com/

    January 12, 2014 at 6:53 pm #84868
    patrick24601
    Member

    I've tried all combination of apostrophes and quotes. It always comes back to the shortcode will not be understood on the home page, but it works fine on an individual post.

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

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