您想在您的帖子或页面中显示 WordPress 导航菜单吗?通常,您的 WordPress 主题会处理导航菜单的显示方式和位置。在本文中,我们将向您展示如何在帖子/页面或 WordPress 网站上的任何位置添加 WordPress 导航菜单。
您想在帖子或页面中显示 WordPress 导航菜单吗?通常,您的 WordPress 主题会处理导航菜单的显示方式和位置。在本文中,我们将向您展示如何将 WordPress 导航菜单添加到帖子/页面或 WordPress 网站上的任何位置。

为什么要在帖子/页面中添加WordPress导航菜单 (Why Add WordPress Navigation Menu in Posts/Pages)
导航菜单 in WordPress provide an easy way to add a structured menu to your site.
WordPress中的导航菜单提供了一种向网站添加结构化菜单的简便方法。
You can create as many navigation menus as you want in your WordPress 管理区, but you can only display them on menu locations available in your WordPress theme.
您可以在WordPress 在管理区创建任意数量的导航菜单,但只能在WordPress主题中可用的菜单位置上显示它们。
What if you needed to add a menu in a 帖子或页面? In that case, you will have to manually create a list of links which is not as efficient to manage as a WordPress menu.
如果您需要在在帖子或页面中添加菜单怎么办? 在这种情况下,您将必须手动创建链接列表,该列表的管理效率不如WordPress菜单。
话虽如此,让我们看看如何在 WordPress 帖子或页面中添加导航菜单。
话虽如此,让我们看看如何向 WordPress 帖子或页面添加导航菜单。
影片教学 (Video Tutorial)
如果您不喜欢该视频或需要更多说明,请继续阅读。
如果您不喜欢该视频或需要更多说明,请继续阅读。
在WordPress帖子/页面中添加导航菜单 (Adding Navigation Menu in WordPress Posts/Pages)
First thing you need to do is install and activate the 菜单简码 plugin. For more details, see our step by step guide on 如何安装 WordPress 插件.
您需要做的第一件事是安装并激活菜单简码插件。 有关更多详细信息,请参阅有关如何安装 WordPress 插件步指南。
Before you can use the plugin, first you will need to create the navigation menu that you want to display. Go to 外观 » 菜单 to create it. See our beginner’s guide on 如何在WordPress中添加导航菜单 for detailed instructions.
在使用插件之前,首先需要创建要显示的导航菜单。 转到外观 » 菜单进行创建。 有关详细说明,请参阅有关如何在 WordPress 中添加导航菜单初学者指南。
Once your menu is ready, you can add it to your posts using 短代码.
菜单准备好后,您可以使用短代码将其添加到您的帖子中。
只需编辑要显示菜单的帖子或页面并添加如下短代码:
只需编辑您希望显示菜单的帖子或页面并添加如下短代码:
[listmenu menu="My menu"]
[listmenu menu="My menu"]
将我的菜单替换为您要添加的导航菜单的名称。
将我的菜单替换为您要添加的导航菜单的名称。
By default, your menu will be displayed as a plain list. If you want to change the appearance of your menu, then see our guide on 如何在 WordPress 中设置导航菜单的样式.
默认情况下,您的菜单将显示为纯列表。 如果要更改菜单的外观,请参阅有关如何在 WordPress 中设置导航菜单的样式指南。
You can add your custom CSS for menus in your 儿童主题‘s stylesheet or by using 简单的自定义 CSS plugin.
您可以在副主题的样式表中添加菜单的自定义CSS,也可以使用简单的自定义CSS插件添加菜单。
However, if you are not familiar with CSS, then you can try CSS 英雄. It is a powerful plugin that allows you to style anything on your WordPress site using a simple user interface and without writing any code.
但是,如果您不熟悉CSS,则可以尝试CSS 英雄 。 它是一个功能强大的插件,可让您使用简单的用户界面在WordPress网站上设置任何样式,而无需编写任何代码。
We hope this article helped you add navigation menu in your WordPress posts or page. You may also want to see our guide on how to 在 WordPress 帖子或页面中创建目录.
我们希望本文能帮助您在WordPress帖子或页面中添加导航菜单。 您可能还想查看有关如何在 WordPress 帖子或页面中创建目录指南。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/plugins/how-to-add-wordpress-navigation-menu-in-posts-pages/