• 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

Conditional remove_action of post-info…

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 › Conditional remove_action of post-info…

This topic is: not resolved

Tagged: conditional, remove_action

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 11 months ago by Jen Baumann.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • November 27, 2012 at 7:53 pm #1969
    mattspaeth
    Member

    I am trying to remove post-info from the display of a single post. This is what I came up with, but it doesn't work. Am I using the wrong hook in the add_action?

    add_action( 'genesis_before_post_content', 'single_conditional_actions' );
    function single_conditional_actions() {
     if ( is_single() ) {
     remove_action( 'genesis_before_post_content', 'genesis_post_info' );
     }
     }
    November 27, 2012 at 9:22 pm #1981
    Jen Baumann
    Participant

    You need to add your action earlier. Try one of these:
    add_action( 'genesis_before', 'single_conditional_actions' );
    add_action( 'template_redirect', 'single_conditional_actions' );

    November 27, 2012 at 10:10 pm #1988
    mattspaeth
    Member

    Thanks Jen, I tried both of your suggestions and it's not working. Is there anything that can conflict with these? The only other additions are a remove_action and an add_action which places post-info above the titles on the home page.

    remove_action( 'genesis_before_post_content', 'genesis_post_info' );
    add_action( 'genesis_before_post_title', 'genesis_post_info' );

    November 27, 2012 at 10:34 pm #1990
    Jen Baumann
    Participant

    Since you've removed it from genesis_before_post_content, you'll need to make your remove action:

    remove_action( 'genesis_before_post_title', 'genesis_post_info' );

    November 30, 2012 at 4:06 pm #2648
    mattspaeth
    Member

    Thank you Jen, that worked great.

    November 30, 2012 at 4:51 pm #2673
    Jen Baumann
    Participant

    You're welcome!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Conditional remove_action of post-info…’ 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

© 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