如何仅在首页wordpress上隐藏菜单 [英] How to hide menu only on Home page wordpress
问题描述
我正在使用一页主题.我想禁用或选择不在主页上显示菜单.但是,当用户向下滚动到下一页时,菜单应该变得固定.我现在已经从主页上删除了菜单,但是我无法将菜单固定在其他页面的顶部.
请咨询.
您也可以采用 CSS
方式.
WordPress在首页的body属性中添加了一个 home
类.您可以定位该特定属性以隐藏菜单,如下所示.
.home .menu-class-name {显示:无;}
这将从首页隐藏菜单,但会在其他页面上显示
注意-用您自己的菜单类替换 .menu-class-name
I m using a one page theme. I would like to disable or choose not to show the menu on the home page. But when user scrolls down to the next page the menu should become fixed. I have removed the menu from the home page now, however i'm not able to get the menu to be fixed on top for the other pages.
Please advice.
You can also go the CSS
way.
WordPress adds a class home
to the body attribute in home page. You can target that particular attribute to hide the menu as shown below.
.home .menu-class-name{
display:none;
}
This will hide the menu from home page but will show it on other pages
Note - replace .menu-class-name
with your own menu class
这篇关于如何仅在首页wordpress上隐藏菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!