remove_action conditionally for Custom Post Type - not working
I'm using a Genesis child theme with the 'Genesis Co-Authors Plus' which enables support for Co-Authors Plus
I'd like to disable the author box everywhere except for the blog.
Genesis Co-Authors Plus removes the default Genesis genesis_do_author_box_single
and replaces it with gcap_author_box
So far I've got a conditional function to remove gcap_author_box
from the custom post type local-bite
I tested the conditional statement with a simple echo and it is working fine. So what is wrong with the following?:
// Remove 'Genesis Co-Authors Plus' from custom post type
add_action('init', 'lf_remove_author_box');
function lf_remove_author_box() {
if ( is_singular( 'local-bite' ) ): {
remove_action( 'genesis_after_entry', 'gcap_author_box', 8 );
}
endif;
}
There is a very similar post here which is helpful.
but I don't understand what I need to put in immediately after add_action - I've copied what is in the Genesis Co-Authors Plus which is init
. I've also tried wp
, can anyone help?
Topic genesis-theme-framework filters Wordpress
Category Web