Site logo

[Resolved] Archive post titles gone after upgrade

Home Forums Support [Resolved] Archive post titles gone after upgrade

Home Forums Support Archive post titles gone after upgrade

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1509878
    Craig

    Hello,
    A recent GP upgrade affected how my Archive pages work.

    New archive (post titles missing) – https://school.stjosephwaconia.org/document-category/saints-news/
    Old archive (post titles working) – http://spmsjwasc.staging.wpengine.com/document-category/saints-news/

    I use the following snippet to hide post titles…and it had been working great for about 3 years…it never affected the archive pages…

    add_action( 'after_setup_theme', 'tu_remove_all_titles' );
    function tu_remove_all_titles() {
        add_filter( 'generate_show_title', '__return_false' );
    }

    Is there a conditional way for this code to not affect archive pages? I think my problem would be solved.

    FWIW – I use a number of Beaver Builder layouts to display the titles…that’s why I was using the snippet above in the first place.

    Thanks!
    Craig

    #1509924
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Yes, that filter now applies to archives as well.

    You should be able to tweak it like this:

    add_action( 'wp', function() {
        if ( is_singular() ) {
            add_filter( 'generate_show_title', '__return_false' );
        }
    } );

    Let me know 🙂

    #1509928
    Craig

    Thanks Tom! Worked perfectly!

    #1510158
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! 🙂

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