WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
Remove navbar only on custom template page (2 posts)

  1. Mike Sneed
    Member
    Posted 7 months ago #

    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

  2. ElectricFeet
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Theme

About this Topic