In my previous tutorial titled How to remove Post info conditionally in Genesis, I shared code to remove post info from
- all archives
- posts on a Page that uses Blog Page Template
- all entries of a particular CPT
What if you want to get rid of the post info from a particular post or a Custom Post Type single entry page?
Ex.: A MemberPress membership page:
Adding
/**
* Remove post info from a specific single post/CPT page
*
* @author Sridhar Katakam
* @link https://sridharkatakam.com/
*/
add_action( 'genesis_before_entry', function () {
// if this is not a single page having a title of "Membership 1", abort.
if ( ! is_single( 'Membership 1' ) ) {
return;
}
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
} );
in child theme’s functions.php will not display the entry meta in entry header aka post info just on this page.
You’d need to replace Membership 1
in the code with the title of your Post/CPT.
[…] Read Full Tutorial February 1, 2017 Genesis Sridhar Katakam Previous Previous Post […]