qt 菜单栏怎么添加搜索框_如何将搜索栏添加到WordPress菜单(逐步)

qt 菜单栏怎么添加搜索框

Do you want to add a search bar to your WordPress navigation menu?

您是否要在WordPress导航菜单中添加搜索栏?

By default, WordPress lets you add a search section on your website sidebar, footer, and other widget-ready areas. However, many users prefer to have the WordPress search box in the navigation menu because it is easily noticeable on the top.

默认情况下,WordPress允许您在网站的侧边栏,页脚和其他可用于小部件的区域中添加搜索部分。 但是,许多用户更喜欢在导航菜单中具有WordPress搜索框,因为它在顶部很容易被注意到。

In this article, we will show you how to easily add a search bar to your WordPress menu without having any coding knowledge.

在本文中,我们将向您展示如何在没有任何编码知识的情况下轻松地将搜索栏添加到WordPress菜单。

Adding a Search Bar to WordPress Menu
为什么要在菜单中添加搜索栏? (Why You Should Add a Search Bar in Menu?)

A site search makes it easy for your users to find what they’re looking for without leaving your website. It helps improve user experience on your website and boosts engagement.

站点搜索使您的用户无需离开您的网站即可轻松找到所需的内容。 它有助于改善您网站上的用户体验并提高参与度。

This is why most usability experts recommend adding a search option in the navigation menu, so users can easily find it.

这就是大多数可用性专家建议在导航菜单中添加搜索选项的原因,以便用户可以轻松找到它。

However, the default WordPress search widget is limited to only widget-ready areas.

但是,默认的WordPress搜索窗口小部件仅限于窗口小部件就绪区域。

Luckily, there are many different WordPress search plugins which let you add the search bar to different locations on your site including menus.

幸运的是,有许多不同的WordPress搜索插件 ,可让您将搜索栏添加到站点上的不同位置,包括菜单。

For this tutorial, we have chosen the Ivory Search free plugin. It allows you to create new custom search forms and enhance the default WordPress search.

在本教程中,我们选择了象牙搜索免费插件。 它允许您创建新的自定义搜索表单并增强默认的WordPress搜索。

With that said, let’s take a look at how to add a search bar to your WordPress menu.

如此说来,让我们看一下如何在WordPress菜单中添加搜索栏。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

在WordPress菜单中添加搜索栏 (Adding a Search Bar to WordPress Menu)

First thing you need to do is to install and activate the Ivory Search plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活象牙搜索插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to visit Ivory Search » Search Forms page to create a new search form.

激活后,您需要访问象牙搜索»搜索表单页面以创建新的搜索表单。

Ivory Search Include Options

The plugin automatically adds the default search form, so you can quickly review its settings and add it to your WordPress menu.

该插件会自动添加默认搜索表单,因此您可以快速查看其设置并将其添加到WordPress菜单中。

Search settings allow you to select which content on your website should be included in the site search.

搜索设置使您可以选择网站搜索中应包括的网站内容。

The ‘Includes’ section lets you choose which post types, posts, pages, category, custom fields, etc. should be included in the search query. You need to review the options and click the Save Form button.

“包含”部分可让您选择搜索查询中应包括哪些帖子类型 ,帖子,页面,类别, 自定义字段等。 您需要查看选项,然后单击“保存表单”按钮。

Next, there is the ‘Excludes’ section, which lets you define the content that you don’t want to show in search results. Once done, click the Save Form button again to store your settings.

接下来,有“排除”部分,可让您定义不想在搜索结果中显示的内容。 完成后,再次单击“保存表单”按钮以存储您的设置。

Ivory Search Exclude Options

The ‘AJAX’ section lets you enable AJAX functionality for your search form.

通过“ AJAX”部分,您可以为搜索表单启用AJAX功能

Ivory WordPress Search Bar AJAX Settings

The ‘Options’ section lets you define how many results to show per search page along with other advanced settings.

通过“选项”部分,您可以定义每个搜索页显示多少个结果以及其他高级设置。

Define Search Results Per Page in Ivory Search Plugin

Now your custom WordPress search form is ready. Once again, don’t forget to save your settings.

现在,您的自定义WordPress搜索表单已准备就绪。 再一次,不要忘记保存您的设置。

After that, the next step is to add the search form to your navigation menu. Simply go to Ivory Search » Settings page to configure the search bar to your WordPress menu.

之后,下一步是将搜索表单添加到导航菜单。 只需转到“ 象牙搜索”»“设置”页面即可将搜索栏配置为WordPress菜单。

On this page, you will see the ‘Select Menu’ tab. From here, you can simply toggle the menu where you would like to add the search bar.

在此页面上,您将看到“选择菜单”选项卡。 从这里,您可以简单地在想要添加搜索栏的菜单之间进行切换。

Select WordPress Menu to Show Search Bar

This list of menus (Primary Menu and Footer Menu) belongs to your WordPress template. If you change the template of your site, then the list will be automatically updated with the available menus from your template.

菜单列表(主菜单和页脚菜单)属于您的WordPress模板 。 如果您更改站点的模板,则列表将自动使用模板中的可用菜单进行更新。

After that, you can choose the search style from the Form Style accordion below.

之后,您可以从下面的“表单样式”手风琴中选择搜索样式。

The plugin allows you to display the search form in five different styles: Default, dropdown, sliding, full width, and popup.

该插件可让您以五种不同的样式显示搜索表单:默认,下拉,滑动,全角和弹出。

Ivory Search Form Styles

If you like, you can further customize the options by going to the ‘Settings’ section below ‘Menu Search’.

如果愿意,可以转到“菜单搜索”下面的“设置”部分进一步自定义选项。

From there, you can add your search form to the header, footer, manage mobile display for search, and more. These settings will also help in controlling the search results for your users.

在这里,您可以将搜索表单添加到页眉,页脚,管理用于搜索的移动显示等。 这些设置还有助于控制用户的搜索结果。

Ivory Search More Settings

Once you are satisfied, make sure to save your settings. After that, you can head over to your website to see the search bar in the WordPress navigation menu.

满意后,请确保保存设置。 之后,您可以转到您的网站以在WordPress导航菜单中查看搜索栏。

Search Bar in WordPress Menu Preview

We hope this article helped you learn how to add a search bar to a WordPress menu. You may also want to see our list of most useful tips to speed up WordPress and boost performance.

我们希望本文能帮助您学习如何向WordPress菜单添加搜索栏。 您可能还想查看我们最有用的技巧列表,以加快WordPress并提高性能

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-add-a-search-bar-to-wordpress-menu-step-by-step/

qt 菜单栏怎么添加搜索框

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值