wordpress 菜单_在WordPress中创建菜单的分步指南

本文介绍了如何使用WordPress内置菜单编辑器创建和管理导航菜单。从创建新菜单开始,规划菜单结构,添加页面、帖子、类别和自定义链接,再到安排菜单顺序,创建子菜单,更改菜单文本,最后将菜单添加到网站上,步骤详尽,助你轻松打造网站菜单。
摘要由CSDN通过智能技术生成

wordpress 菜单

Navigation menus are important elements of your WordPress website that carry out two vital functions. Firstly, they are the main way that your visitors will use to find the information they are looking for and secondly, they help search engines understand how your website is structured so that it can be indexed more easily. Without a menu, much of your web content would be inaccessible. In this article, we’ll show you how easy it is to create menus using the built-in  WordPress menu editor.

导航菜单是WordPress网站的重要元素,具有两个重要功能。 首先,它们是访问者用来查找他们正在寻找的信息的主要方式,其次,它们可以帮助搜索引擎了解您网站的结构,以便更轻松地对其进行索引。 如果没有菜单,您的许多Web内容将无法访问。 在本文中,我们将向您展示使用内置的WordPress菜单编辑器创建菜单有多么容易。

步骤1.创建一个新菜单 (Step 1. Creating a new menu)

在WordPress中创建菜单的分步指南

该过程的第一步是创建一个新菜单。 为此,您将需要: (
The first step in the process is to create a new menu. To do this you will need to:
)

  1. Login to your WordPress admin panel.

    登录到您的WordPress管理面板。
  2. Go to ‘Appearance’ in the left-hand sidebar and select ‘Menus’. This will open the Menu Editor.

    转到左侧边栏中的“外观”,然后选择“菜单”。 这将打开菜单编辑器。
  3. Go to the top of the Menu Editor and select ‘Create a new menu’.

    转到菜单编辑器顶部,然后选择“创建新菜单”。
  4. Give your new menu a name in the Menu Name box and click on Create Menu.

    在“菜单名称”框中为新菜单命名,然后单击“创建菜单”。

Your new menu is now created and ready to work on.

现在,您的新菜单已创建并可以使用。

步骤2.规划菜单 (Step 2. Planning your menu )

Once your menu has been created, you’ll want to add items to it so that your visitors can find their way around your website. However, you should first consider what you want to use the menu for before adding items to it. Most websites have several menus, each with a different function. The main or primary menu is the most important as it goes near the top of every page, just underneath the header, and helps people find the most important content.

创建菜单后,您需要向其中添加项目,以便访问者可以在您的网站周围找到自己的方式。 但是,在向其中添加项目之前,您应该首先考虑要使用菜单的内容。 大多数网站都有几个菜单,每个菜单具有不同的功能。 主菜单或最主要菜单最重要,因为它靠近页面顶部,标题下方,并帮助人们找到最重要的内容。

In addition, there is often a menu that deals with more administrative matters and includes links to terms and conditions, privacy policies, account details, contact pages, etc. This menu is often found at the very top of each page, above the header, or at the very bottom in the footer.

此外,通常会有一个菜单处理更多的管理事务,并包含指向条款和条件,隐私策略,帐户详细信息,联系页面等的链接。此菜单通常位于每个页面的顶部,标题上方,或位于页脚的最底部。

You will also find that some WordPress sites have other menus in their sidebar which link to specific posts, pages and other content.

您还将发现某些WordPress网站的侧边栏中还有其他菜单,这些菜单链接到特定的帖子,页面和其他内容。

Once you have decided which kind of menu you are creating, you can begin to consider the items you will add. There are four main types of item that you can add to your menu: pages, posts, custom links and categories. Some themes and plugins will also add additional item types, such as product categories, which you can include in your menu as well.

确定要创建哪种菜单后,就可以开始考虑要添加的项目了。 您可以将四种主要类型的项目添加到菜单中:页面,帖子,自定义链接和类别。 一些主题和插件还将添加其他项类型,例如产品类别,您也可以将其包括在菜单中。

  1. Pages: You can add a link to any page on your website. You will probably not need to put a link to every page, but if this is your main menu, then you should always put a link to your home page.

    页面:您可以添加指向网站上任何页面的链接。 您可能不需要在每个页面上都放置一个链接,但是如果这是您的主菜单,则应该始终在首页上放置一个链接。

  2. Posts: You can add a link to any individual post on your website. Most people do not do this unless they are creating a custom menu of their most important posts. For main menus, rather than individual posts, the normal practice is to add a link to a category.

    帖子:您可以在网站上添加指向任何单个帖子的链接。 除非他们要为其最重要的帖子创建自定义菜单,否则大多数人不会这样做。 对于主菜单,而不是单个帖子,通常的做法是将链接添加到类别。

  3. Category: You can add a link to each of your categories. This is a common practice with many WordPress users, especially those who use their sites as a blog.

    类别:您可以为每个类别添加一个链接。 这是许多WordPress用户的惯常做法,尤其是那些将其网站用作博客的用户。

  4. Custom Links: Here you can add a link to anywhere on the internet. Many WordPress users use these links to let customers download resources or visit other sites. If you run more than one website or your website has a subdomain, you can use a custom link take your visitors there.

    自定义链接:您可以在此处添加到Internet上任何地方的链接。 许多WordPress用户使用这些链接来让客户下载资源或访问其他站点。 如果您经营多个网站,或者您的网站有一个子域,则可以使用自定义链接将访问者带到那里。

步骤3:将项目添加到菜单 (Step 3: Adding items to the menu)

With the exception of custom links, which have to be manually created, adding posts, pages and categories is a very simple process. On the left of the Menu Edit page, you will see a collapsible menu with the four item types shown.

除了必须手动创建的自定义链接之外,添加帖子,页面和类别是一个非常简单的过程。 在“菜单编辑”页面的左侧,您将看到一个可折叠的菜单,其中显示了四种项目类型。

Step by Step Guide to Creating a Menu in WordPress

  1. Start by clicking on the Pages pane of the menu and then on the View All link. This will show you all the pages you have created on your website.

    首先单击菜单的“页面”窗格,然后单击“查看全部”链接。 这将显示您在网站上创建的所有页面。
  2. Click on the check boxes to select the pages you want to add to the menu.

    单击复选框以选择要添加到菜单的页面。
  3. Click ‘Add to Menu’  at the bottom of the pane and you will see the items appear in the menu list at the right side of the page.

    单击窗格底部的“添加到菜单”,您将看到项目显示在页面右侧的菜单列表中。
  4. Finally, remember to click on ‘Save Menu’.

    最后,请记住单击“保存菜单”。
  5. Once you have finished adding pages, you can then proceed to add categories and posts if you wish.

    完成添加页面后,您可以根据需要继续添加类别和帖子。

要添加自定义链接,请执行以下操作: (To add a custom link, do the following:)

Step by Step Guide to Creating a Menu in WordPress

  1. Click on the Custom Links panel

    单击“自定义链接”面板
  2. In the URL box, type in or paste the URL of the page you want the link to take your visitor.

    在“ URL”框中,键入或粘贴您希望链接吸引访问者的页面的URL。
  3. In the Link Text box, type the words you want to appear on the menu for the link.

    在“链接文本”框中,键入要显示在链接菜单上的单词。
  4. Click ‘Add to Menu’ and then click ‘Save Menu’

    点击“添加到菜单”,然后点击“保存菜单”

安排菜单 (Arranging your menu)

Once you have added items to your menu, there are three other options you need to consider:

将项目添加到菜单后,还需要考虑其他三个选项:

  1. The order in which things will appear on the menu.

    东西在菜单上出现的顺序。
  2. Whether some items should be created as main items or sub items in a menu.

    是否应在菜单中将某些项目创建为主项目还是子项目。
  3. What text you want to appear on the menu.

    您想在菜单上显示什么文本。

更改订单 (Changing the order)

Changing the order in which things appear on the menu is very simple, you just need to drag and drop the menu items into the order you desire.

更改菜单上的内容显示顺序非常简单,只需要将菜单项拖放到所需的顺序即可。

创建子菜单项 (Creating submenu items)

There are two reasons why you may want to create sub items on a menu. Firstly, there might not be enough space in the width of your webpage to fit all the items you want and this can produce a very ugly web page for your visitors. Secondly, sometimes it makes it easier for your visitors to navigate. For example, if you have a shop on your site, it might be easier to have a main menu item labelled ‘Shop’ and when this is clicked on three submenu items appear for shoes, jewellery and watches. It would certainly make the menu more organised than having three separate main menu items.

您可能要在菜单上创建子项目有两个原因。 首先,您的网页宽度可能没有足够的空间容纳您想要的所有项目,这可能会为访问者生成一个非常难看的网页。 其次,有时它使您的访客更容易导航。 例如,如果您的站点上有一家商店,则拥有一个标有“商店”的主菜单项可能会更容易,并且当单击该菜单时,会出现三个子菜单项,分别用于鞋子,珠宝和手表。 与拥有三个独立的主菜单项相比,它肯定会使菜单更有组织性。

Step by Step Guide to Creating a Menu in WordPress

要创建子菜单项: (To create submenu items:)

  1. Position the cursor on the link you wish to be a submenu item

    将光标放在您希望成为子菜单项的链接上
  2. Hold the left mouse button and drag it underneath the link that will be the main item.

    按住鼠标左键并将其拖动到将成为主要项目的链接下方。
  3. Once underneath, drag it to the right and release the mouse button.

    一旦在下面,将其拖到右侧并释放鼠标按钮。
  4. Click the Save Menu.

    单击保存菜单。

更改菜单文字 (Changing the menu text)

You can change the text that appears on a link in the menu any time you wish. This can be helpful if you need to shorten the width of a menu item to make it look more aesthetic or to give more room to add a new item.

您可以随时更改菜单中链接上显示的文本。 如果您需要缩短菜单项的宽度以使其看起来更美观或为添加新项留出更多空间,则这将很有帮助。

Step by Step Guide to Creating a Menu in WordPress

要更改文本,您需要: (To change the text you need to:)

  1. Find the item in the menu and click on expand arrow on the right hand side of the title box.

    在菜单中找到该项目,然后单击标题框右侧的展开箭头。
  2. Go the Navigation Label box and type in the new label you wish to appear on the menu.

    转到导航标签框,然后键入您希望出现在菜单上的新标签。
  3. Click save menu.

    点击保存菜单。

将菜单添加到您的网站 (Adding the menu to your website)

Different themes have different options for menus. Some only allow one menu, others allow more. You can find the options on the Edit Menu page at the bottom, under Menu Settings.  Once you are satisfied that your menu is finished you need to:

不同的主题具有不同的菜单选项。 一些只允许一个菜单,另一些只允许一个菜单。 您可以在底部的“菜单设置”下的“编辑菜单”页面上找到这些选项。 对菜单完成感到满意后,您需要:

  1. Scroll to the Menu Setting section and then to Theme Locations .

    滚动到“菜单设置”部分,然后滚动到“主题位置”。
  2. Click the check box for the location where you want your new menu to appear.

    单击您想要新菜单出现的位置的复选框。
  3. Click Save menu.

    点击保存菜单。

Your new menu should now appear on your website.

您的新菜单现在应该会出现在您的网站上。

结论 (Conclusion)

From reading this article you should now have a better understanding of how to:

通过阅读本文,您现在应该对如何进行更好的了解:

  • create a new menu

    创建一个新菜单
  • add posts, pages, categories and custom links to a menu

    在菜单中添加帖子,页面,类别和自定义链接
  • rearrange the order of items in a menu

    重新排列菜单中项目的顺序
  • create a submenu

    创建一个子菜单
  • change the navigation label of a menu

    更改菜单的导航标签

If you are looking for dedicated WordPress hosting, check out our WordPress Hosting page. Our affordable packages are packed with useful features and backed up with expert WordPress support and first-class security.

如果您正在寻找专用的WordPress托管,请查看我们的WordPress 托管页面。 我们负担得起的软件包包含有用的功能,并由专家WordPress支持和一流的安全性支持。

翻译自: https://www.eukhost.com/blog/webhosting/step-by-step-guide-to-creating-a-menu-in-wordpress/

wordpress 菜单

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值