If you are going to be setting the notice dynamically, what I would do is just pull in the notice in the callback function. But if you can’t do that for whatever reason, you can do a little wizardry like so:
if( $notice ) {
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action ( 'genesis_entry_content', function() use ($notice) {
echo $notice;
}, 5 );
}
This takes advantage of the php use
keyword available to anonymous functions.
Related Posts:
- How to add code just below opening body tag in Genesis framework
- Adding ads after a certain number of paragraphs within Genesis themework
- How do I turn a 404 page into an automatic search with the info from the url?
- WordPress Hide Show Content script and activate/deactivate script on screensize
- Genesis menu position change
- Is it possible to roll back to a previous customization of Genesis?
- How can I eliminate the inline styles included by default with the Genesis framewrok?
- Portfolio-template won’t show items
- Move Archive Title to Entry Title – Genesis
- Modify Genesis Custom Header CSS
- How to remove the Navigation Bar (prim. and sec.) from the Homepage for the Genesis Framework?
- Notice: Undefined variable: thumbnail [closed]
- Issue echoing the site’s title in Genesis child theme
- Genesis loading of html5shiv for IE8
- Multiple loops in Genesis
- How to enable full column width in Genesis layout options
- Genesis framework : how to display the primary sidebar manually?
- How to create and set a separate template file for articles in Genesis framework? (WordPress)
- genesis grid loop only showing one column
- Plugin for user comments, star ratings, badge, activity
- Insert custom metatag in all the internal pages of the site, less in the homepage
- Cropping a thumbnail with a Genesis child theme
- Genesis themes: how do alter the markup of post meta on archive pages? [closed]
- Getting Genesis Entry Headers Back on Post Tiltes
- Genesis page template with Powerpress
- New Genesis child theme or revise current Genesis child theme [closed]
- How to change title “Search Results for:….” in search results page of genesis?
- How to display post title on top of image with Genesis Featured Posts
- How to create a page template that display posts with a certain category in the Genesis Framework?
- Genesis Style Selector causes PHP warning [closed]
- Display current category title on category page
- Any advantage of using wp_scripts and is_IE when enqueuing scripts
- Genesis – Customize search form
- Modify the post/entry wrapper markup in genesis childtheme [closed]
- Genesis Child and Custom Post Type
- Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?
- Change Genesis Tag from Page Template [closed]
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- StudioPress: add meta tag to every page [closed]
- How to add specific menu on a specific page or pages
- get_post_meta not working inside loop
- How to keep my custom theme changes after updating genesis child theme
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Removing http:// from esc url() for wordpress customizer code
- Second nav is merged with the first in mobile
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- WordPress Genesis Child Theme Filter divs
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- How to modify a title tag in genesis?
- Log in link not showing, Comment Issue
- PHP loop that selects posts with a particular in-post option
- add_action and remove_action if custom field exists
- Select full Image Size on widget “Genesis – Featured Posts”
- How to change the layout of a product page
- wp_enqueue_scripts leads to error
- Adding function to Genesis genesis_header [closed]
- Genesis multiple category custom loop 404s after first page
- How to remove Date from Meta Description on SERP?
- Display video on homepage for users who have not logged in
- Add an Outside Wrapper to my Header and Make it Full Width
- Custom Post Type on Homepage – Studiopress Genesis Framework
- How to sell an album for download
- Use custom template on custom post type
- Query to get child pages of current page and display it in action hook
- display text on the same line
- Genesis Framework: How to exclude a specific author from archive custom loop
- wp_query on page template not working (Genesis framework)
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- How to change the standard navigation menu color when using genesis [closed]
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- Responsive menu on genesis theme [closed]
- What file is the tag located in Genesis default theme?
- links to Media Library content in sidebar per page
- changing genesis_before_while in new theme framework
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- Link custom post type to page
- Using mu-plugins on the Genesis Framework
- Is_single not working properly in genesis
- I would like to have a quote page just to show quotes
- author.php not showing content if Author has no Posts
- Move woocommerce shop page image to left
- remove_action(‘genesis_header’,’genesis_do_header’) hook not working
- How do I add footer widgets to the StudioPress Monochrome Pro theme?
- How to use regular page template for search results?
- Clone a Post Tite and Custom Field into Custom Post type
- 404 Pagination issue for only one category
- Add an ‘edit profile’ page with Genesis
- Different read-more link for each custom post type [closed]
- remove_action conditionally for Custom Post Type – not working
- Custom Category Page Not Working [duplicate]
- WordPress URL Problems and Layout
- adding navigation to genesis themes
- What to do when child theme is out of date with parent theme
- Why is my hamburger menu not shown? [closed]
- Display Featured Image
- How to display custom message for (Genesis) featured posts if no posts
- Query posts by Custom Meta (checkbox) & Genesis Grid Loop
- Custom Post Type Pagination For Genesis Child Theme [closed]
- I’m new in developing responsive WordPress Theme, so which framework to use or work from scratch? [closed]