WordPress.org

Support

Support » Themes and Templates » Remove navbar only on custom template page

Remove navbar only on custom template page

  • Hi,

    I’m working on a piece where I actually want to remove the navbar altogether and offer navigation in the form of buttons in the content area.. this code works but I DON’T want to remove the navbar on the rest of the site which this code does; rather, only on the custom template page.

    Here’s my code:

    <?php
    add_action('tc_menu_display', 'remove_navbar');
    function remove_navbar(){
    	if ( ! is_page_template( 'custom-page-template.php' ) )
            return;
        remove_action('__navbar', array(TC_init::$instance, 'navbar'), 30, 1);
    }
    ?>

    Does anybody know the code by chance?
    Thanks, heaps!
    Michael

Viewing 1 replies (of 1 total)
  • Same as my other reply: put it in the template itself. Then you can be sure it only runs when you have the template running.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove navbar only on custom template page’ is closed to new replies.