Title: Random Content Shortcode
Author: Nico
Published: <strong>2016 年 9 月 8 日</strong>
Last modified: 2018 年 2 月 5 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/random-content-shortcode.svg)

# Random Content Shortcode

 作者：[Nico](https://profiles.wordpress.org/nico23/)

[下载](https://downloads.wordpress.org/plugin/random-content-shortcode.zip)

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

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

## 描述

Check out the [plugins page](https://nextgenthemes.com/plugins/random-content-shortcode/)
to see it in action.

Simple Shortcode for displaying random content on your site. Just wrap the shortcode
arround the lines of content you want one to be displayed at random.

The following example will display one of the two videos or one of the two lines
of text, empty lines will ignored.

    ```
    [random_content]

    A line with some text in it.

    [arve url="https://youtu.be/b1rTZJxEnAQ" title="A Video Embedded with ARVE" maxwidth="350"]

    A bold line.

    [arve url="https://vimeo.com/124400795" title="A Video Embedded with ARVE" maxwidth="400"]

    [/random_content]
    ```

By default the newline `\n` character is used to separate content. You can also 
choose another separator, do this if you have problems with the default or like 
to have random content with multiple lines on one piece like this:

    ```
    [random_content separator="|||"]
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

    Aenean commodo ligula eget dolor. Aenean massa.
    |||
    Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

    Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
    |||
    Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate

    Aenean commodo ligula eget dolor. Aenean massa.
    [/random_content]
    ```

Or have a compact single line like this:

    ```
    [random_content separator="#"]One#Two#Three#Four[/random_content]
    ```

## 安装

Please refer to [codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation](https://codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation).

## 常见问题

  Installation Instructions

Please refer to [codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation](https://codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation).

## 评价

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

### 󠀁[2021 and it still work](https://wordpress.org/support/topic/2021-and-it-still-work/)󠁿

 [Volgogradec](https://profiles.wordpress.org/volgogradec/) 2021 年 3 月 2 日

Very simple plugin for trivial task.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/random-content-shortcode/reviews/)

## 贡献者及开发者

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

贡献者

 *   [ Nico ](https://profiles.wordpress.org/nico23/)

[帮助将「Random Content Shortcode」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/random-content-shortcode)

### 对开发感兴趣吗?

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

## 更新日志

### 2018-02-03 – 2.1.0

 * Fixed new version not working in sidebars.

### 2018-02-03 – 2.0.1

 * Namespace fix.

### 2018-02-02 – 2.0.0

 * Fix: Plugin not working correctly. Sometimes displaying nothing …
 * Improved: Added `[random_content]` shortcode because I read that dashes work 
   but are not recommended. `[random-content]` still works for backwards compatibility
   but you should use `[random_content]`.
 * Improved: Rewritten the the JavaScript and some PHP code. Removed jQuery dependancy.
 * Improved: Loads script early and dequeue it in case its not needed.

### 2016-11-07 – 1.3.3

 * Fix php error on admin screen.

### 2016-11-05 – 1.3.1

 * Fix spelling error the `seperator` attribute is now `separator`.
 * Fix plugin sometimes showing nothing.

### 1.2.1 – 2016-09-09

 * Fix plugin not working correctly.

### 1.1.0 – 2016-09-08

 * Rewrite some php and addind Javascript to make it work with chaching.

### 1.0.0 – 2016-09-07

 * Release

## 额外信息

 *  版本 **2.1.0**
 *  最后更新：**8 年前**
 *  活跃安装数量 **80+**
 *  WordPress 版本 ** 4.5.0 或更高版本 **
 *  已测试的最高版本为 **5.0.0**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/random-content-shortcode/)
 * 标签
 * [random](https://cn.wordpress.org/plugins/tags/random/)[random content](https://cn.wordpress.org/plugins/tags/random-content/)
   [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/random-content-shortcode/advanced/)

## 评级

 5 星（最高 5 星）。

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

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

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

## 贡献者

 *   [ Nico ](https://profiles.wordpress.org/nico23/)

## 支持

有话要说吗？是否需要帮助？

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

## 捐助

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

 [ 捐助此插件 ](https://nextgenthemes.com/donate/)