Simple Hooks & PHP Conditionals – Hiding Header

Community Forums Forums General Discussion Simple Hooks & PHP Conditionals – Hiding Header

This topic is: resolved

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 4 months, 1 week ago.

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

    ScottFromPA
    Member
    Post count: 26

    Hello,

    I’ve been digging hard into PHP conditionals but I’m having trouble with clarity on one task.

    I need to hide / remove the genesis_entry_header hook on all pages with the exception of the blog.

    Any idea on how to accomplish this? Is it possible to turn off the hook while inside the Genesis Simple Hook plugin?

    Thanks for the help.

    • This topic was modified 4 months, 2 weeks ago by  ScottFromPA.
    • This topic was modified 4 months, 2 weeks ago by  ScottFromPA.
    #117473

    braddalton
    Participant
    Post count: 10667

    Maybe you can unhook that hook using Simple hooks but it will apply globally so you need a custom function for that.


    #117475

    ScottFromPA
    Member
    Post count: 26

    Brad,

    Will this do it?

    It removes titles from specified pages.

    add_action( ‘get_header’, ‘remove_titles_from_pages’ );
    function remove_titles_from_pages() {
    if ( is_page(array(contact, about) ) ) {
    remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    }
    }

    #117478

    braddalton
    Participant
    Post count: 10667

    Should be good with that code Scott.


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

The topic ‘Simple Hooks & PHP Conditionals – Hiding Header’ is closed to new replies.