最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Hiding Menu From Specific Pages

programmeradmin0浏览0评论

I’m trying to hide the menu page completely from this page:

I’m using Divi 3.0, and have tried – through online tutorials – to hide it using the following in my styles css sheet:

.page-id-27820 top-menu-nav {
display: none important;
}

That didn’t do anything, aside from making the menu look a little weird (and dropping the search magnifying glass down a bit), and I removed the code – the search button still looks weird.

if anyone could help me with how to remove the menu completely (and logo etc) from that one page, I’d be very much appreciative!

I’m trying to hide the menu page completely from this page:

http://ultimate-templates/splash-page

I’m using Divi 3.0, and have tried – through online tutorials – to hide it using the following in my styles css sheet:

.page-id-27820 top-menu-nav {
display: none important;
}

That didn’t do anything, aside from making the menu look a little weird (and dropping the search magnifying glass down a bit), and I removed the code – the search button still looks weird.

if anyone could help me with how to remove the menu completely (and logo etc) from that one page, I’d be very much appreciative!

Share Improve this question asked Jan 26, 2017 at 22:52 AlexAlex 1311 gold badge1 silver badge2 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 4

Created a simple image for you on how to get page id and menu attributes. https://dl.dropboxusercontent/s/zibhieyo3s6a5bs/Mailbird_2017-01-27_00-57-39.png

You need to get the page_id, exactly as you did:

.page-id-27820 

and hide the menu, like so:

.page-id-27820 #top-menu-nav {
    display: none;
}

You forgot the # sign, which stand for html attribute id

id = #
class = .

Go to header.php and find the wp_nav_menu(); function.

Example:

    <div class="main-navigation">
        <?php wp_nav_menu(array('theme_location' => 'nav-name')); ?>
    </div>

You could wrap it in a check for the current page. $post is available as a global variable.

<?php if($post->post_name !== 'splash-page'): ?>
    <div class="main-navigation">
        <?php wp_nav_menu(array('theme_location' => 'nav-name')); ?>
    </div>

I was having the same issue.

I pasted below code to custom css in divi theme

.page-id-28577 #top-menu-nav {
    display: none;
}

.page-id-28577 = body class of the page that I don't want to show menu on

Try this:

.container.clearfix.et_menu_container { display: none; }

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论