wordpress添加媒体_如何在WordPress中添加和使用小部件

wordpress添加媒体

Beginner users often ask us what are widgets and how to use widgets in WordPress. Widgets allow you to add different functionality and features to your WordPress sidebars without writing any code. In this article, we will show you how to add and use Widgets in WordPress along with sharing Widget examples.

初学者经常问我们什么是小部件以及如何在WordPress中使用小部件。 小部件使您无需编写任何代码即可向WordPress侧边栏添加不同的功能。 在本文中,我们将向您展示如何在WordPress中添加和使用Widget,以及共享Widget示例。

How to Add and Use Widgets in WordPress
什么是小部件? 为什么需要在WordPress中使用小部件? (What are Widgets? Why You Need to Use Widgets in WordPress?)

Widgets are tiny blocks of specific functionality that you can place in your WordPress sidebars (also known as widget-ready-areas). For beginners, this is an easy way to add things like galleries, quotes, popular posts, facebook like boxes, and other dynamic items on their WordPress site.

窗口小部件是特定功能的微小块,您可以将其放置在WordPress边栏中 (也称为窗口小部件就绪区域)。 对于初学者来说,这是在其WordPress网站上添加图库,报价,热门帖子,facebook之类的Facebook框和其他动态项之类的简便方法。

Widgets can be found on Appearance » Widgets page in your WordPress admin area.

可以在WordPress 管理区域中的“ 外观”»“小部件”页面上找到小部件

Widgets screen on a WordPress site

You will see the widgets that you can add under the list of available widgets.

您将在可用窗口小部件列表下看到可以添加的窗口小部件。

On your right hand, you will find the designated areas on your WordPress site where you can place these widgets. These designated areas are defined by your WordPress theme. They are called sidebars or widget-ready areas.

在您的右手边,您将在WordPress网站上找到可以放置这些小部件的指定区域。 这些指定区域由WordPress主题定义。 它们被称为补充工具栏或可用于小部件的区域。

If you don’t see a specific widget you’re looking for, then it can likely be added with a plugin (more on this later).

如果您没有找到所需的特定小部件,则可以将其添加有插件(稍后将对此进行详细介绍)。

在WordPress的侧边栏中添加小部件 (Adding Widget to a Sidebar in WordPress)

There are multiple ways to add widgets to sidebars available in your WordPress theme. The easiest one is to simply drag and drop them to your sidebar.

有多种方法可以将小部件添加到WordPress主题中可用的边栏中。 最简单的方法是将它们拖放到侧边栏。

Animation showing how to drag and drop a Widget to a sidebar in WordPress

You can also click on a widget title from the list of available widget. WordPress will show you the list of sidebars where you can add this widget.

您也可以从可用窗口小部件列表中单击窗口小部件标题。 WordPress将显示您可以在其中添加此小部件的侧边栏列表。

Simply select the sidebar where you want to add the widget, and then click on Add widget button to add it.

只需选择要在其中添加小部件的侧边栏,然后单击“添加小部件”按钮将其添加。

Add widget button

There is also an accessibility mode for users who need it. To enable accessibility mode, you need to click on the Screen Options button at the top right corner of the screen.

对于需要它的用户,还有一种可访问性模式。 要启用辅助功能模式,您需要单击屏幕右上角的“屏幕选项”按钮。

Turn on accessibility mode for widgets in WordPress

It will display a fly down menu with a link to enable accessibility mode for widgets screen. Clicking on it will change the user interface of the widgets screen.

它将显示一个带有链接的下拉菜单,以启用小部件屏幕的辅助功能模式。 单击它会更改小部件屏幕的用户界面。

Each available widget will now have a simple ‘Add’ button. clicking on the button will take you to an accessible screen where you can easily select the sidebar.

每个可用的小部件现在都将具有一个简单的“添加”按钮。 单击该按钮将带您进入一个易于访问的屏幕,您可以在其中轻松选择侧边栏。

Accessible widgets in WordPress

For detailed instructions see our guide on how to add WordPress widgets in accessibility mode.

有关详细说明,请参阅有关如何在辅助功能模式下添加WordPress小部件的指南。

The widgets page is not the only way to add widgets to your WordPress site. You can also add widgets using the live preview by visiting Appearance » Customize.

窗口小部件页面不是将窗口小部件添加到WordPress网站的唯一方法。 您还可以通过访问外观»自定义来使用实时预览添加小部件。

Animation adding a widget with customizer in WordPress

It’s important to note that not all of your widget-ready areas and sidebars will appear in the customizer. This is why we recommend using the Appearance » Widgets screen to add widgets in WordPress.

重要的是要注意,并非您的所有小部件就绪区域和侧边栏都会出现在定制器中。 这就是为什么我们建议使用“ 外观»小部件”屏幕在WordPress中添加小部件的原因。

如何在WordPress中删除小部件? (How to Remove a Widget in WordPress?)

Removing a widget in WordPress is just as simple as adding them. Visit the Appearance » Widgets page.

在WordPress中删除小部件就像添加它们一样简单。 访问外观»小部件页面。

Look for the widget that you want to remove in your sidebars and click on the widget title to expand it.

在边栏中查找要删除的小部件,然后单击小部件标题以将其展开。

Removing a widget by deleting it from your WordPress sidebar

Below the widget settings, you will find the link to delete the widget. Deleting a widget will remove it from your sidebar and will also delete widget settings like title or any options that you selected.

在小部件设置下方,您会找到删除小部件的链接。 删除窗口小部件会将其从边栏中删除,还将删除窗口小部件设置,例如标题或您选择的任何选项。

Some widgets are too simple and don’t have many options in their settings while others have many options and settings. If you would like to remove a widget without losing the settings, then you need to drag and drop it to the inactive widgets section.

一些小部件太简单,设置中没有太多选项,而其他小部件则具有很多选项和设置。 如果要删除小部件而不丢失设置,则需要将其拖放到非活动小部件部分。

Removing a widget without deleting its settings

Deleting or sending a widget to inactive widgets does not remove it from the list of available widgets. You can always add a widget again from the list of available widgets or inactive widgets.

将小部件删除或发送到非活动小部件不会将其从可用小部件列表中删除。 您始终可以从可用窗口小部件或非活动窗口小部件的列表中再次添加窗口小部件。

WordPress可使用哪种小部件? (What Kind of Widgets are Available for WordPress?)

A default WordPress installation comes with some built-in widgets like recent posts, recent comments, archives, search, etc.

默认的WordPress安装附带一些内置的小部件,例如最近的帖子,最近的评论,存档,搜索等。

Many WordPress themes and plugins come with their own plugins.

许多WordPress主题和插件都带有自己的插件。

For example, Envira Gallery plugin allows you to create beautiful image galleries in your WordPress posts and pages. But it also comes with an Envira Gallery widget, which you can add to a sidebar to display image galleries in WordPress.

例如, Envira Gallery插件可让您在WordPress帖子和页面中创建漂亮的图库。 但是它还带有一个Envira Gallery小部件,您可以将其添加到侧边栏以在WordPress中显示图像画廊

Envira gallery widget

Similarly, countless other themes and plugins add widgets, so their users can add things to their WordPress sidebars without writing any code or html.

同样,无数其他主题和插件也添加了小部件,因此他们的用户可以将内容添加到WordPress边栏中,而无需编写任何代码或html。

There are hundreds of WordPress plugins that just add widgets for you to use in your sidebar. See our list of the 25 most useful WordPress widgets for your site.

数百个WordPress插件仅添加了小部件供您在边栏中使用。 请参阅我们为您的站点提供的25个最有用的WordPress小部件列表。

您还可以使用WordPress小部件做什么? (What Else You Can do With WordPress Widgets?)

Widgets are an incredibly powerful and flexible tool in WordPress. WordPress developers have been using them in many innovative ways.

小部件是WordPress中功能强大且灵活的工具。 WordPress开发人员已经以许多创新方式使用它们。

As a WordPress site owner, you can take advantage of that to add almost anything imaginable to your WordPress site. Get started with our 12 WordPress sidebar tricks to get maximum results.

作为WordPress网站所有者,您可以利用它为WordPress网站添加几乎所有可以想象的内容。 开始使用我们的12个WordPress侧边栏技巧以获取最大的效果

If you are comfortable with code, then you may want to learn how to create a custom WordPress widget of your own.

如果您对代码感到满意,则可能需要学习如何创建自己的自定义WordPress小部件

That’s all, we hope this article helped you learn how to add and use widgets in WordPress. You may also want to see our guide on how to display different sidebar for each post and page in WordPress.

仅此而已,我们希望本文能帮助您学习如何在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/beginners-guide/how-to-add-and-use-widgets-in-wordpress/

wordpress添加媒体

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值