How To Hide Page Titles On Specific Pages

Community Forums Forums Design Tips and Tricks How To Hide Page Titles On Specific Pages

This topic is: not resolved

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  SoZo 1 year, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2110

    bravomedia
    Participant
    Post count: 3

    I’m using the following code to hide titles on my site.
    It works like a champ!

    /** Remove page titles */
    add_action( 'get_header', 'child_remove_page_titles' );
    function child_remove_page_titles() {
        if ( is_page() && ! is_page_template( 'landing.php' ) )
            remove_action( 'genesis_post_title', 'genesis_do_post_title' );
    }

    >>The problem is it hides ALL titles on the site, including the homepage, instead of just hiding them on the landing.php template

    The code snippet was entered here: Genesis > Custom Code > Custom Functions
    We’re using Prose v.1.8.2

    Any ideas how to hide titles strictly on our landing pages and display them everywhere else?

    Thanks,
    ~RB

     

    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    • This topic was modified 1 year, 4 months ago by  bravomedia.
    #2164

    SoZo
    Moderator
    Post count: 1573

    You’d need to edit the conditional code. This statement ”! is_page_template( ‘landing.php’ )” is saying DON”T do this on the any page using the landing page template. The “!” is the not statement. And unless you edited your landing page template the template that is usually included with Genesis themes is “page_landing.php”.

    You could also do away with the code altogher and get the Genesis Title Toggle plugin.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.