[Resolved] generate_show_title not working

Home Forums Support [Resolved] generate_show_title not working

Home Forums Support generate_show_title not working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #299650
    Dan

    It was my understanding the adding the following code to the Code Snippets would remove all Page Titles from the site, but it is not working. What else do I need to do to get this working?

    Here is the code
    add_filter( ‘generate_show_title’, ‘remove_my_titles’ );
    function remove_my_titles()
    {
    return ‘false’;
    }

    #299652
    Leo
    Staff
    Customer Support

    Hi Dan,

    The filter should still work and the code looks good.

    Can you make sure Code Snippet is activated and make sure you click “Save Changes and Activate” in the actual snippet?

    Let me know.

    #299664
    Tom
    Lead Developer
    Lead Developer

    In some cases, a custom function can fire before the filter is ready.

    When that happens, we can add the filter into a hook like after_setup_theme to make sure the function fires once the filter exists and is ready:

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

    Thanks Tom – the hook worked.

    You are a genious!!!

    #299739
    Tom
    Lead Developer
    Lead Developer

    Glad I could help 🙂

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