Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was thinking of removing navigation on my contact page.

I was thinking of inserting a conditional statement and an inline CSS style to "display: none;" if the page template was the contact page.

Is there a better way?

I'm using Twenty Eleven as a parent theme.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You could try putting this code in your functions.php

function remove_contact_nav( $nav_menu, $args ){

    if( is_page_template('template-contact.php') || is_page( 'contact' ) ) {
        $nav_menu = null;
    }

    return $nav_menu;
}
add_filter( 'wp_nav_menu', 'remove_contact_nav', 11, 2 );

The if condition need to be modified as per your template name or the second condition would also do if your contact page slug is contact

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.