admin管理员组文章数量:1332394
I use Divi plugin.
I have these menu items:
- Blog
- Enterprise
- Coach
- Help
On my home page, I have these 4 items: OK When I click on "Entreprise" item (to show enterprise page), I want to hide automatically "Blog" item into toolbar menu. And of course if I come back on home page, I want to show "Blog" item.
How can I do that please?
I use Divi plugin.
I have these menu items:
- Blog
- Enterprise
- Coach
- Help
On my home page, I have these 4 items: OK When I click on "Entreprise" item (to show enterprise page), I want to hide automatically "Blog" item into toolbar menu. And of course if I come back on home page, I want to show "Blog" item.
How can I do that please?
Share Improve this question asked Jul 9, 2020 at 4:57 AnthonyAnthony 1011 Answer
Reset to default 1Add this code to your functions.php
:
function hide_menu_items( $items ) {
if ( is_page( 'Enterprise' ) ) { // You can use page ID, slug or title here
foreach ($items as $key => $item) if ( $item->title == "Blog" ) unset( $items[$key] );
}
return $items;
}
add_filter( 'wp_get_nav_menu_items', 'hide_menu_items', 20 );
本文标签: customizationDivi how to hideshow specific menu according current page
版权声明:本文标题:customization - Divi: how to hideshow specific menu according current page? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742281295a2446142.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论