Answer the question
In order to leave comments, you need to log in
How to hide the menu on a specific page in WP?
Hide the main menu on a specific page of a WordPress site. A la code
if(!is_page(100) && !is_page(200) && !is_page(300)) {
get_template_part('primer');
} else {
get_template_part('none');
}
Answer the question
In order to leave comments, you need to log in
Most likely, your menu is displayed via wp_nav_menu( [ 'menu' => 'Навигация' ] );
If you need to hide, for example, on a page with ID 100, then the code will be something like this:
if ( is_page(100) ) {
// Это страница с ID 100
// Ничего не показываем
} else {
// Это страница НЕ с ID 100
// Показываем меню
wp_nav_menu( [ 'menu' => 'Навигация' ] );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question