Hello, I’m trying to remove author, date, category and tag from single posts (but keep them for archive pages).
I don’t understand when to call the filters. I tried something like that but it doesn’t work. I guess the after_setup_theme is not the right action. Can you help ? Thank you
/* Remove meta on single post */
add_action( ‘after_setup_theme’, ‘remove_post_meta’ );
function remove_post_meta() {
if ( is_singular( ‘post’) ) {
add_filter( ‘generate_post_author’, ‘__return_false’ );
add_filter( ‘generate_post_date’, ‘__return_false’ );
add_filter( ‘generate_show_categories’, ‘__return_false’ );
add_filter( ‘generate_show_tags’, ‘__return_false’ );
add_filter( ‘generate_show_comments’, ‘__return_false’ );
}
}