• 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

Where to add code for feature box opt-in before posts

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 › Where to add code for feature box opt-in before posts

This topic is: not resolved

Tagged: theme functions

  • This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by danstelter.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • February 11, 2017 at 10:17 am #200965
    danstelter
    Member

    Hey -

    List building will be core to my business. I want to have a feature box before the post title like https://smartblogger.com/mediocre-blogger/

    Here's the code I need to insert for the Magic Action Box plugin: mab_get_actionbox( ACTION_BOX_ID )

    Also, where would I do that to go after the posts - before the comments, but after the related posts list (see: http://www.anxietysupportnetwork.com/goodbye-terrifying-anxiety-hello-rewarding-life/)?

    Appreciate your help,

    Dan

    February 11, 2017 at 11:29 am #200968
    Brad Dalton
    Participant

    Something like this in your functions file

    add_action( 'genesis_entry_header', 'your_function', 5 );
    
    function your_function() {
    
    if ( ! is_singular())
        return;
    
    // Your function call or template tag
    
    }
    

    Replace // Your function call or template tag with a valid function call or template tag otherwise this code will NOT work.


    Tutorials for StudioPress Themes.

    February 13, 2017 at 1:20 pm #201063
    danstelter
    Member

    Hmm. Okay. So this is what I have:

    add_action( 'genesis_entry_header', 'after_header_feature_box', 5 );

    function after_header_feature_box() {

    if ( ! is_singular())
    return;

    mab_get_actionbox( 538 );

    }

    Made a few mistakes at first, and it broke my theme. Got that fixed. Theme works with it in functions.php. But still can't get the darn thing to actually show up.

    What am I missing?

    February 13, 2017 at 1:48 pm #201067
    Brad Dalton
    Participant

    Try

    echo mab_get_actionbox( 538 );

    Tutorials for StudioPress Themes.

    February 13, 2017 at 5:20 pm #201091
    danstelter
    Member

    That worked! But it added the feature box to single pages as well as single posts.

    Any way to stop that from happening?

    February 14, 2017 at 3:12 am #201112
    Brad Dalton
    Participant

    Please check the conditional tag


    Tutorials for StudioPress Themes.

    February 14, 2017 at 2:43 pm #201179
    danstelter
    Member

    Got it. Perfect. Thank you. This is critical to my site's success!

  • 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