Title: XV Random Quotes
Author: Xavi Ivars
Published: <strong>2015 年 8 月 18 日</strong>
Last modified: 2026 年 3 月 29 日

---

搜索插件

![](https://ps.w.org/xv-random-quotes/assets/banner-772x250.png?rev=1225466)

![](https://ps.w.org/xv-random-quotes/assets/icon-256x256.png?rev=1223504)

# XV Random Quotes

 作者：[Xavi Ivars](https://profiles.wordpress.org/xavivars/)

[下载](https://downloads.wordpress.org/plugin/xv-random-quotes.2.9.0.zip)

 * [详情](https://cn.wordpress.org/plugins/xv-random-quotes/#description)
 * [评价](https://cn.wordpress.org/plugins/xv-random-quotes/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/xv-random-quotes/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/xv-random-quotes/#developers)

 [支持](https://wordpress.org/support/plugin/xv-random-quotes/)

## 描述

XV Random Quotes helps you collect and display random quotes everywhere on your 
WordPress site. Built with modern WordPress standards using Custom Post Types, Gutenberg
blocks, and the REST API.

**🎯 Modern WordPress Integration**

 * **Custom Post Type** – Quotes are managed as native WordPress posts with full
   revision history
 * **Gutenberg Blocks** – Three dedicated blocks: Random Quote, Specific Quote, 
   and List Quotes
 * **REST API** – Access quotes programmatically for headless WordPress and custom
   integrations
 * **Taxonomy Support** – Organize quotes with categories and authors (with URL 
   support)
 * **Block Editor** – Full support with dedicated meta boxes for quote content and
   source

**✨ Key Features**

 * **Multiple Display Methods** – Widgets, shortcodes, template tags, and Gutenberg
   blocks
 * **AJAX-Powered Widgets** – Automatic quote rotation without page reload (configurable
   timer)
 * **Category Filtering** – Display quotes from specific categories or all quotes
 * **Author Management** – Track quote authors with optional URL links
 * **Flexible Ordering** – Random or sequential quote display
 * **Native Styling Toggle** – Use plugin’s default styling or your theme’s styles
 * **Complete Backward Compatibility** – All legacy shortcodes and template tags
   still work

**📦 Display Options**

 * **Gutenberg Blocks**:
    - Random Quote Block – Display one or more random quotes
    - Specific Quote Block – Show a particular quote by ID
    - List Quotes Block – Paginated list of quotes with filtering
 * **Widgets**: Sidebar widget with AJAX refresh and category filtering
 * **Shortcodes**: `[stray-random]`, `[stray-id]`, `[stray-all]` for posts and pages
 * **Template Tags**: `stray_random_quote()`, `stray_a_quote()` for theme integration
 * **REST API**: `/wp-json/xv-random-quotes/v1/quote/random` for custom integrations

**🔄 Automatic Migration**

Upgrading from v1.x? The plugin automatically detects the need of migrating your
existing quotes to the new Custom Post Type system. The migration is always manual
to prevent race conditions and duplicate imports. When the plugin is activated or
updated, an admin notice prompts the user to start the migration via a button. The
migration then processes quotes in batches via AJAX.

**🎨 Customization**

 * Customize HTML wrappers (before/after quote, author, source)
 * Control author and source link formatting
 * AJAX loading messages and animations
 * Native WordPress styling or custom CSS

See [RELEASE_NOTES.md](https://github.com/xavivars/xv-random-quotes/blob/main/RELEASE_NOTES.md)
for complete v2.0 features and migration guide.

### Credits

 * For main development of Stray Quotes, [Ico](http://unalignedcode.wordpress.com/my-wordpress-plugins/stray-random-quotes/)
 * For Multi-widget functionality, [Millian’s tutorial](http://wp.gdragon.info/2008/07/06/create-multi-instances-widget/)
 * For help in developing user-end AJAX functionality, [AgentSmith](http://www.matrixagents.org)
 * For search functionality and bugfixing, [Sergey Sirotkin](http://www.zeyalabs.ch/posts/2010/stray-quotes-z/)

### Localization

 * German, thanks to Markus Griesbach
 * Chinese, thanks to WGMking
 * Croatian, thanks to [Rajic](http://www.atrium.hr/)
 * Danish, thanks to [Georg](http://wordpress.blogos.dk/)

Actually, these translations are not updated to the latest version.
 I am looking
for new localizers, all languages welcome!

_Please note:_ the best way to **submit new or updated translations** is to send
me a direct link to the localization files in [the contact page](http://xavi.ivars.me/contacta/)
of my website. This way the files are made available to the users sooner, and without
waiting for a new release.

_Please note:_ If you want to create a localized copy of XV Random Quotes, consider
skipping the help page and translate the rest. This will save you quite some time.
The help page has a lot of text.

### Known Issues

None currently reported for v2.0. If you find an issue, please report it on [GitHub](https://github.com/xavivars/xv-random-quotes/issues).

## 屏幕截图

[⌊Gutenberg blocks in the block inserter⌉⌊Gutenberg blocks in the block inserter⌉[

Gutenberg blocks in the block inserter

[⌊Random Quote block in the editor⌉⌊Random Quote block in the editor⌉[

Random Quote block in the editor

[⌊Quote management using WordPress Custom Post Types⌉⌊Quote management using WordPress
Custom Post Types⌉[

Quote management using WordPress Custom Post Types

[⌊Quote editing with meta boxes for content and source⌉⌊Quote editing with meta 
boxes for content and source⌉[

Quote editing with meta boxes for content and source

[⌊Widget settings with AJAX options⌉⌊Widget settings with AJAX options⌉[

Widget settings with AJAX options

[⌊Settings page for display customization⌉⌊Settings page for display customization⌉[

Settings page for display customization

## 区块

该插件提供了 3 个区块.

 *   Random Quote Display one or more random quotes
 *   Specific Quote Display a specific quote by ID
 *   List Quotes Display a list of quotes with pagination

## 安装

**Automatic Installation**

 1. Go to Plugins > Add New in your WordPress admin
 2. Search for “XV Random Quotes”
 3. Click “Install Now” and then “Activate”
 4. If upgrading from v1.x, migration will start automatically

**Manual Installation**

 1. Download the plugin zip file
 2. Upload to `/wp-content/plugins/` directory
 3. Activate the plugin through the ‘Plugins’ menu in WordPress
 4. Go to Quotes > All Quotes to start adding quotes

**After Installation**

 * **New Installation**: Go to Quotes > Add New to create your first quote
 * **Upgrading from v1.x**:
    - Small databases (≤500 quotes) migrate automatically on activation
    - Large databases show an admin notice with “Start Migration” button
    - All existing quotes, categories, and settings are preserved
    - See migration guide in RELEASE_NOTES.md for details

**Using Gutenberg Blocks**

 1. Edit any post or page
 2. Click the + button to add a block
 3. Search for “quote” to find the three quote blocks:
 4.  * Random Quote – Display random quotes with category filtering
     * Specific Quote – Show a particular quote by ID
     * List Quotes – Paginated list with ordering options

**Using Widgets**

 1. Go to Appearance > Widgets
 2. Add “XV Random Quotes” widget to your sidebar
 3. Configure categories, display options, and AJAX settings
 4. Save and view your site

**Using Shortcodes**

Add to any post or page content: – `[stray-random]` – Display a random quote – `[
stray-random categories="inspiration,wisdom"]` – Random quote from specific categories–`[
stray-id id="123"]` – Display a specific quote – `[stray-all]` – Display all quotes
with pagination

See the Help page (Quotes > Help) for complete documentation.

## 常见问题

### What’s new in version 2.0?

Version 2.0 is a complete modernization using WordPress Custom Post Types, Gutenberg
blocks, and REST API. All legacy features remain fully compatible.

### Will my existing quotes be lost when upgrading?

No! The plugin automatically migrates all existing quotes from the old database 
table to the new Custom Post Type system. Categories, authors, and all metadata 
are preserved.

### How does the migration work?

 * **Small databases (≤500 quotes)**: Automatic migration on plugin activation
 * **Large databases (>500 quotes)**: Shows admin notice with “Start Migration” 
   button for batch processing
 * Migration is safe and can be resumed if interrupted
 * Original data remains in the database for safety

### Can I still use my old shortcodes?

Yes! All legacy shortcodes work exactly as before: `[stray-random]`, `[stray-id]`,`[
stray-all]`, and template tags like `stray_random_quote()`.

### How do I use the Gutenberg blocks?

 1. Edit any post or page in the Block Editor
 2. Click + to add a block
 3. Search for “quote”
 4. Choose from: Random Quote, Specific Quote, or List Quotes blocks
 5. Configure block settings in the sidebar

### Can I use AJAX to refresh quotes without page reload?

Yes! Enable AJAX in the widget settings. You can set a timer for automatic rotation
or allow manual refresh with a click link.

### How do I add quotes?

Go to Quotes > Add New in your WordPress admin. Add the quote title, content (with
basic formatting), author, source, and categories just like creating a post.

### Can I organize quotes into categories?

Yes! Use the Quote Categories taxonomy (similar to post categories). Assign multiple
categories to each quote and filter by category in widgets, blocks, and shortcodes.

### How do I add author information with a link?

 1. Go to Quotes > Authors
 2. Add or edit an author
 3. In the “Author URL” field, enter the author’s website
 4. Author names will automatically link to their URLs when displayed

### Does this work with the Classic Editor?

Yes! The plugin works with both the Block Editor and Classic Editor. Meta boxes 
are available for adding quote content and source in both editors.

### Is there a REST API endpoint?

Yes! Access random quotes via `/wp-json/xv-random-quotes/v1/quote/random` with parameters
for categories, sequence, and more. Perfect for headless WordPress.

### Can I customize the HTML output?

Yes! Go to Quotes > Settings to customize HTML wrappers, link formats, and styling
options. You can also toggle native styling to use your theme’s styles.

### Where can I get support?

 * Documentation: Quotes > Help in your WordPress admin
 * GitHub Issues: https://github.com/xavivars/xv-random-quotes/issues
 * WordPress Forums: https://wordpress.org/support/plugin/xv-random-quotes

### How do I contribute?

Contributions are welcome! Visit the GitHub repository at https://github.com/xavivars/
xv-random-quotes and submit pull requests or report issues.

## 评价

![](https://secure.gravatar.com/avatar/030903c5f21888676458826ff944a40a440fa6dcfe7d8d03fb5888a7c1010c58?
s=60&d=retro&r=g)

### 󠀁[Thank You! – It Still Works Great](https://wordpress.org/support/topic/thank-you-it-still-works-great/)󠁿

 [karban](https://profiles.wordpress.org/karban/) 2023 年 4 月 7 日

Thank you to the developer for this great little plugin. Using it on the latest 
WP (6.2) without any problems, despite the fact it hasn’t been updated in quite 
a while. I really hope you will continue to develop it, it’s the best Random Quote
plugin that I could find after the one I was using was abandoned and had a security
issue so I was forced to remove it and try this one – I’m glad I did as it’s excellent.
Thanks again for all your hard work.

![](https://secure.gravatar.com/avatar/20cc49eb7af038fa1da24d75e77bb310a57f3c1ac573496c162a73a8cd47daa5?
s=60&d=retro&r=g)

### 󠀁[Seemed perfect but…](https://wordpress.org/support/topic/seemed-perfect-but/)󠁿

 [dgfdrhhdf](https://profiles.wordpress.org/dgfdrhhdf/) 2022 年 9 月 23 日 5 回复

Exactly what I wanted, in theory but unfortunately not compatible with my version
of WP. 6.0.2 Shapely theme

![](https://secure.gravatar.com/avatar/89176e091fdee83a28b9b4722e0fd6e7ba616d12aca18617786521d040a5a9e5?
s=60&d=retro&r=g)

### 󠀁[Thank You!](https://wordpress.org/support/topic/thank-you-1010/)󠁿

 [seedy](https://profiles.wordpress.org/seedy/) 2017 年 1 月 25 日

I’ve been limping along with the ancient Random Quotes and Random Quotes Widget 
plugins, but RQ was getting ragged around the edges and finally failing to add a
quote as of 4.7. XV Random Quotes started up the first time and did not wreck my
quote collection, they’re all still there. The ancient Random Quotes Widget still
works with it if needed, but XVRQ widget works perfectly in the sidebar. Thank you
Xavi! It’s great when developers have compassion for users. The best WP plugins 
are made by people like you. carl.krall.org

![](https://secure.gravatar.com/avatar/a5a137312cecfe4d87229695cf24e31513b436f212d8dd26e2525d0e6409bcae?
s=60&d=retro&r=g)

### 󠀁[Simple Text Rotation — Perfect for my needs!](https://wordpress.org/support/topic/simple-text-rotation-perfect-for-my-needs/)󠁿

 [sneader](https://profiles.wordpress.org/sneader/) 2016 年 9 月 3 日 2 回复

Wow, I wasted SO much time looking for a SIMPLE text rotation plugin. I am so glad
I found this one. It is perfect for my needs. Other plugins add so much formatting
or require extensive CSS to format properly. This one just shows the text! What 
a concept! It is actually a pretty feature rich plugin, and I won’t go into all 
the details here, but there is a lot more under the hood than meets the eye. Thank
you for providing this plugin!

![](https://secure.gravatar.com/avatar/7abbb8824cbebcf40137cdc78dc9940c1e5561aa2a81473b6ce7877c019bb4db?
s=60&d=retro&r=g)

### 󠀁[Does not work with theme Soledad](https://wordpress.org/support/topic/does-not-work-with-theme-soledad/)󠁿

 [marjolein299](https://profiles.wordpress.org/marjolein299/) 2016 年 9 月 3 日 
1 回复

All kind of errors happened after this plugin had been installed. After testing,
this one really caused it. Which is a pity because I liked the features very much.

 [ 阅读所有5条评价 ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/)

## 贡献者及开发者

「XV Random Quotes」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Xavi Ivars ](https://profiles.wordpress.org/xavivars/)

「XV Random Quotes」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/xv-random-quotes/contributors)
为本插件所做的贡献。

[帮助将「XV Random Quotes」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/xv-random-quotes)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/xv-random-quotes/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/xv-random-quotes/)，或通过[RSS](https://plugins.trac.wordpress.org/log/xv-random-quotes/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/xv-random-quotes/)。

## 更新日志

See changelog.txt for complete version history.

## 额外信息

 *  版本 **2.9.0**
 *  最后更新：**2 月前**
 *  活跃安装数量 **300+**
 *  WordPress 版本 ** 6.0 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [Catalan](https://ca.wordpress.org/plugins/xv-random-quotes/) 和 [English (US)](https://wordpress.org/plugins/xv-random-quotes/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/xv-random-quotes)
 * 标签
 * [blocks](https://cn.wordpress.org/plugins/tags/blocks/)[gutenberg](https://cn.wordpress.org/plugins/tags/gutenberg/)
   [quotes](https://cn.wordpress.org/plugins/tags/quotes/)[random](https://cn.wordpress.org/plugins/tags/random/)
   [widget](https://cn.wordpress.org/plugins/tags/widget/)
 *  [高级视图](https://cn.wordpress.org/plugins/xv-random-quotes/advanced/)

## 评级

 3.7 星（最高 5 星）。

 *  [  4 条 5 星评价     ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/?filter=2)
 *  [  2 条 1 星评价     ](https://wordpress.org/support/plugin/xv-random-quotes/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/xv-random-quotes/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/xv-random-quotes/reviews/)

## 贡献者

 *   [ Xavi Ivars ](https://profiles.wordpress.org/xavivars/)

## 支持

最近两个月解决的问题：

     总计 1，已解决 0

 [查看支持论坛](https://wordpress.org/support/plugin/xv-random-quotes/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://xavi.ivars.me/codi/xv-random-quotes-wordpress-plugin-english/)