简体   繁体   English

修改wordpress wp_nav_menu网址

[英]modify wordpress wp_nav_menu url

How could I change the code generated by wp_nav_menu? 如何更改wp_nav_menu生成的代码?

Right now it generates: 现在它会生成:

<ul class="rounded ">
<li class="arrow"><a href="http://diner.mobileversion.co/menus/">Menus</a></li>
</ul>

I'd like it to look like this: 我希望它看起来像这样:

<ul class="rounded ">
<li class="arrow"><a href="/#menus/">Menus</a></li>
</ul>

i found this link, but could not get it working properly. 我找到了此链接,但无法正常工作。

http://wordpress.org/support/topic/how-do-i-modify-wp_nav_menu-link-hrefs?replies=2 http://wordpress.org/support/topic/how-do-i-modify-wp_nav_menu-link-hrefs?replies=2

The link from support forum doesn't talk about the version number of the wordpress that he is using. 支持论坛的链接未提及他使用的wordpress的版本号。 I am currently on 3.2.1, it is having the menu options under Appearance section. 我目前在3.2.1上,它在外观部分下具有菜单选项。 You can check out this awesome post on menus . 您可以在菜单上查看此很棒的帖子 It gives you an option of modifying the href as well. 它还为您提供了修改href的选项。

I hope you are on version > 3. If not possible to update then it has to be done using wp functions. 我希望您使用的版本>3。如果无法更新,则必须使用wp函数来完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM