Archived topic
Show title filter is not applied
3 replies · Started by Martin on January 1, 2017
Hi,
I have a strange effect with this filter, if I activate it in snippets all page titles are still shown:
add_filter( 'generate_show_title', '__return_false' );
But if I change the code directly in functions.php and force a return value of false it works.
Other filters in the same snippet are applied correctly (e.g. generate_get_blog_page_header).
Any ideay why this could fail?
Regards
Martin
It may need to be placed in the after_setup_theme hook: https://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme
add_action( 'after_setup_theme','tu_after_setup_theme' );
function tu_after_setup_theme() {
add_filter( 'generate_show_title', '__return_false' );
}
That is correct, with this snippet it works as intended.
Thank you.
Martin
You're welcome :)