Archived topic
Show titles on single blog pages although "generate_show_title" filter is used
3 replies · Started by Jan on February 19, 2020
Hi,
I used the "generate_show_title" filter and page titles are not shown on standard pages. But now I need titles to be displayed on single blog pages only.
Is there any way to exclude blog pages from the filter?
Thanks Jan
Hi there,
you could use a conditional tag in your function, this will apply only if its a Page:
add_action( 'wp', function() {
if ( is_page() ) {
add_filter( 'generate_show_title', '__return_false' );
}
} );
Some other conditions here:
https://docs.generatepress.com/article/using-hooks-conditional-tags/
OR you can use the Layout Element to disable the Content Title
https://docs.generatepress.com/article/layout-element-overview/
Thanks David,
worked like a charm...
Jan
You're welcome