【问题标题】:Modify wordpress template - adding submenu修改wordpress模板-添加子菜单
【发布时间】:2019-05-09 03:14:11
【问题描述】:

我正在对网站进行一些维护。我认为这很容易,但我无法显示子菜单。客户说模板是为他们开发的,所以可能没有包含子菜单功能。

我对php知之甚少(实际上我知道的很少),我在google上找不到解决方案。我可以很好地使用 html 和 css 来设置它的样式,但在我需要它显示之前。

这是我在 header.php 中的代码:

<span id="toggle_nav" class="icon-menu"></span>
    <?php wp_nav_menu( array( 'theme_location' => 'main-navigation', 'container' => false, 'menu_id' => 'nav', 'menu_class' => '', 'link_after' => '', 'depth' => 1, 'fallback_cb' => false ) ); ?>

提前致谢,

丹尼尔

【问题讨论】:

  • 尝试将 'depth' => 1 更改为 'depth' => 0 并检查。
  • 谢谢,它起作用了...即使它在 css 方面弄乱了所有菜单...:/

标签: wordpress wordpress-theming submenu


【解决方案1】:

Ash Patel 的评论确实是正确的解决方案:

'depth' => 1 

'depth' => 0 

【讨论】:

    猜你喜欢
    • 2015-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-05
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多