wordpress侧边栏_如何在WordPress侧边栏中显示随机引号

wordpress侧边栏

Do you want to display your favorite quotes in your WordPress site? Perhaps you have inspiring and motivational quotes that you want to auto-rotate in your sidebar? In this article, we will show you how to easily add random quotes in WordPress sidebar.

您想在WordPress网站中显示自己喜欢的报价吗? 也许您想在侧边栏中自动旋转鼓舞人心的报价? 在本文中,我们将向您展示如何轻松地在WordPress边栏中添加随机引号。

Add random quotes in WordPress sidebar

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

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

Upon activation, you need to visit Quotes Collection » Options page to setup the plugin settings.

激活后,您需要访问Quotes Collection»Options页面以设置插件设置。

Quotes Collection settings page

Here you can change the text of link that will show a different quote to users. You can also select the number of iterations to load on refresh, the default option is 20.

在这里,您可以更改链接的文本,该文本将向用户显示不同的引用。 您还可以选择要在刷新时加载的迭代次数,默认选项为20。

If your site shows the same quote to users due to your cache plugin, then you need to check the last option ‘Dynamically fetch the first random quote in widget’.

如果您的站点由于使用了缓存插件而向用户显示相同的报价,那么您需要检查最后一个选项“在小部件中动态获取第一个随机报价”。

Don’t forget to click on the Update Options button to save your changes.

不要忘记单击“ 更新选项”按钮以保存您的更改。

添加报价以建立您的报价集合 (Adding Quotes to Build Your Quotes Collection)

While there are WordPress plugins that allow you to automatically fetch quote of the day from popular quotes websites. The problem with using those plugins is that they will link back to their own website in each quote.

虽然有WordPress插件可让您从热门报价网站自动获取当天的报价。 使用这些插件的问题在于,它们会在每个引用中链接回自己的网站。

Quotes Collection lets you build your own collection of quotes. This allows you to offer a more authentic user experience by adding quotes that are more suitable for your website and your users.

报价集合可让您构建自己的报价集合。 这样,您可以通过添加更适合您的网站和用户的报价来提供更真实的用户体验。

Simply visit Quotes Collection » Add New page to start adding random quotes.

只需访问Quotes Collection»添加新页面即可开始添加随机报价。

Adding quotes to your WordPress site

Enter quote text and then enter the author name. You can optionally mention a source if you want.

输入引用文本,然后输入作者姓名。 如果需要,您可以选择提及来源。

You can also add tags for each quote. This is optional and will allow you to later fetch quotes based on tags.

您还可以为每个报价添加标签 。 这是可选的,以后您可以根据标签获取报价。

Lastly, check the box next to Public option to make your quote publicly available. Unchecking this box will keep your quote stored as a draft, and it will not appear in the sidebar widget or shortcode.

最后,选中“ 公共”选项旁边的框以使报价公开。 取消选中此框将使报价保存为草稿,并且不会出现在侧边栏小部件或简码中。

Finally, click on the Add Quote button to save the quote. Repeat the process to add more quotes.

最后,单击添加报价按钮以保存报价。 重复该过程以添加更多报价。

You can always edit a quote by visiting Quotes Collection » All Quotes page and clicking on the edit link below the quote you want to edit.

您始终可以通过以下方式编辑报价:访问“ 报价”»“所有报价”页面,然后单击要编辑的报价下方的编辑链接。

Edit quotes
在您的WordPress网站上显示随机报价 (Displaying Random Quotes on Your WordPress Site)

Quotes Collection provides multiple ways to display quotes. Depending on how and where you want to display random quotes on your site, you can choose any of these methods.

Quotes Collection提供了多种显示报价的方法。 根据您希望在网站上显示随机报价的方式和位置,可以选择以下任何一种方法。

First method uses the plugin’s built-in widget. This method is easier and recommended for beginner users.

第一种方法使用插件的内置小部件 。 此方法更简单,建议初学者使用。

Visit the Appearance » Widgets page in WordPress admin area.

访问WordPress 管理区域中外观»小部件页面。

Under the list of available widgets, you will find Random Quote widget. Simply drag and drop the widget to a sidebar where you want to display random quotes.

在可用的小部件列表下,您会找到随机报价小部件。 只需将小部件拖放到要显示随机报价的侧边栏

Adding random quotes widget to WordPress sidebar

The widget settings are quite self explanatory and default options would work for most websites.

窗口小部件设置很容易解释,默认选项适用于大多数网站。

The most important option is the ability to refresh quotes and the ability to auto-rotate quotes every X seconds.

最重要的选项是每隔X秒刷新引号和自动旋转引号的能力。

Once you are done choosing your settings, click on the save button to store your widget settings.

选择完设置后,单击“保存”按钮以存储小部件设置。

You can now visit your website to see random quotes displayed in sidebar with an Ajax powered link to load next quote.

现在,您可以访问您的网站以查看侧边栏中显示的随机报价,并使用Ajax支持的链接加载下一个报价。

Ajax display of random quotes in WordPress sidebar

The second method is to use a shortcode to display quotes in WordPress posts and pages. Simply add this shortcode to a page or post where you want to display quotes.

第二种方法是使用简码WordPress帖子和页面中显示引号。 只需将此简码添加到要显示报价的页面或帖子中即可。

[quotcoll ]

[quotcoll ]

You will notice that the plugin will just display all your quotes in a list.

您会注意到,该插件只会在列表中显示所有报价。

Showing quotes in post or page using shortcode

Unfortunately, the shortcode method does not come with ajax refresh feature. It is intended to display a plain list of quotes on posts and pages.

不幸的是,shortcode方法没有ajax刷新功能。 它旨在在帖子和页面上显示简单的报价清单。

However, it does come with lots of parameters that you can use to control the display of quotes.

但是,它确实带有许多参数,可用于控制引号的显示。

Here are a few examples of using the shortcode with different parameters.

以下是将短码与不同参数一起使用的一些示例。

This will display all quotes where Martin Luther King, Jr. is the author.

这将显示所有马丁·路德·金(Martin Luther King,Jr)的报价。 是作者。

[quotcoll author="Martin Luther King, Jr."]

[quotcoll author="Martin Luther King, Jr."]

This will display quotes tagged with inspirational,motivational, and life tags.

这将显示带有励志,动机和生活标签的报价。

[quotcoll tags="inspirational,motivational,life"]

[quotcoll tags="inspirational,motivational,life"]

This will display 10 quotes on each page with pagination.

这将在每个页面上显示10个带有分页的报价。

[quotcoll paging=true limit_per_page=10]

[quotcoll paging=true limit_per_page=10]

Quotes list with pagination

Visit plugin’s documentation page for a full list of parameters.

访问插件的文档页面以获取完整的参数列表。

在不同的WordPress网站之间导入和导出报价 (Import and Export Quotes Between Different WordPress Sites)

Quotes collection comes with built-in import/export feature. It allows you to export and download your quotes collection from one site and then import them to another site.

报价收集带有内置的导入/导出功能。 它允许您从一个站点导出和下载报价集,然后将其导入到另一个站点。

Simply visit Quotes Collection » Export page to download your collection in a file.

只需访问Quotes Collection»导出页面以文件形式下载您的收藏。

Export your quotes collection

After that you need to install the plugin on the WordPress site where you want to import the quotes.

之后,您需要在要导入报价的WordPress网站上安装插件。

Now visit Quotes Collection » Import page to upload and add quotes from your export file.

现在访问Quotes Collection»导入页面以上传和添加导出文件中的报价。

Import quotes into other WordPress site

That’s all, we hope this article helped you learn how to show random quotes in WordPress sidebar. You may also want to see our list of 25 most useful WordPress widgets for your site.

仅此而已,我们希望本文能帮助您学习如何在WordPress侧边栏中显示随机引号。 您可能还想查看我们的网站25个最有用的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-show-random-quotes-in-wordpress-sidebar/

wordpress侧边栏

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值