[Resolved] Show titles on single blog pages although "generate_show_title" filter is used

Home Forums Support [Resolved] Show titles on single blog pages although "generate_show_title" filter is used

Home Forums Support Show titles on single blog pages although "generate_show_title" filter is used

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1170162
    Jan

    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

    #1170256
    David
    Staff
    Customer Support

    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/

    #1170466
    Jan

    Thanks David,

    worked like a charm…
    Jan

    #1170534
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.