Remove meta and info from sticky posts

This snippet does what it says. It removes post_info and post_meta from all sticky posts.

add_action( 'genesis_before_post','child_conditional_action');
function child_conditional_action() {
if(is_sticky() ) {
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}
else {
add_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}
}
About Greg Wallace

My name is Greg Wallace. I am a WordPress website developer and designer specializing in the Genesis Framework by StudioPress.

Comments

  1. Kelly Garrett says:

    Where does this go? I’m using a Prose child theme…should it go in the Prose functions.php?

    I’m new to Genesis – trying to figure out how it all works.

    Thanks.

Speak Your Mind

*