[WordPress] 外掛分享: Random Content Shortcode

首頁外掛目錄 › Random Content Shortcode
90+
安裝啟用
★★★★★
5/5 分(1 則評價)
2964 天前
最後更新
問題解決
WordPress 4.5.0+ PHP 5.6+ v2.1.0 上架:2016-09-07

內容簡介

可以參考外掛頁面,看看如何操作。

這是一個簡單的短代码,可以在您的網站上顯示隨機內容。只需將短代码放在您想隨機顯示的內容上下方。

以下這個例子會隨機顯示兩個影片和兩行文字,空行會忽略不顯示。

[random_content]

一行文字。

[arve url="https://youtu.be/b1rTZJxEnAQ" title="儲存在 ARVE 中的影片" maxwidth="350"]

粗體文字。

[arve url="https://vimeo.com/124400795" title="儲存在 ARVE 中的影片" maxwidth="400"]

[/random_content]

預設使用換行字元 \n 來區分內容,您也可以選擇其他區隔符號。如果預設無法正常運作,或您想要在一個區塊中隨機顯示多行內容,可以嘗試這個方式:

[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]

或者在一行中使用逗號分隔,像這樣:

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

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Random Content Shortcode」→ 直接安裝(推薦)

原文外掛簡介

Check out the plugins page 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]

延伸相關外掛

文章
Filter
Apply Filters
Mastodon