非常感谢能帮助我的人。
问题如下:
在我的菜单中,我在每个菜单项下面都有一个描述,即所谓的Walker菜单。 但我想要实现的是显示/回显标题旁边的菜单描述。
我的代码是:
<header class="margin-1">
<span class="title-container">
<h1 class="title"><?php the_title(); ?></h1>
<h2 class="title-sub">Walker menu description here!</h2>
</span>
</header>
但有可能实现这样的目标吗? :
<header class="margin-1">
<span class="title-container">
<h1 class="title"><?php the_title(); ?></h1>
<h2 class="title-sub"><?php echo walker_description(); ?></h2>
</span>
</header>
我上传了一张我想要实现的图片来澄清我的问题。 http://www.filedropper.com/schermafbeelding-2013-10-17-om-213900
我不知道你们是否需要它,但这里是我的步行者菜单代码:
<section id="section-header" class="center">
<div class="container">
<?php do_action( 'before' ); ?>
<header id="masthead" class="row" role="banner">
<?php $walker = new Menu_With_Description; ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'walker' => $walker ) ); ?>
<a class="site-branding" href="http://www.infused.nl/home/">
<img src="<?php bloginfo('template_directory') ?>/img/logo.png" />
</a>
<?php $walker = new Menu_With_Description; ?>
<?php wp_nav_menu( array( 'theme_location' => 'secundary', 'walker' => $walker ) ); ?>
</header><!-- #masthead -->
</div>
</section>
我的网站几乎已经完成,除此之外,同时我使用静态html显示与walker菜单中相同的文本。但我希望通过Wordpress菜单界面可以编辑它。
非常感谢提前!
你真诚的,
Christiaan Bruinsma
荷兰