[WordPress] 外掛分享: Text Spinner

首頁外掛目錄 › Text Spinner
WordPress 外掛 Text Spinner 的封面圖片
1,000+
安裝啟用
★★★☆☆
3.9/5 分(7 則評價)
2491 天前
最後更新
問題解決
WordPress 2.5+ v1.3.0 上架:2014-03-05

內容簡介

這個小型外掛可以讓你在文章、頁面和佈景主題檔案中使用類似 {phrase 1|phrase 2|phrase 3} 的 spintax。只需將要處理的內容置於短碼 [wpts_spin] [/wpts_spin] 中,每次頁面載入時都會生成一個獨特的副本。或者,你可以將 spintax 字串傳遞給函數 wpts_spin(),並顯示返回的值。

這個外掛可以幫助你避免重複內容的懲罰。例如,如果你有一大塊需要出現在整個網站上的文本,那麼你可以為其編寫 spintax,並使用上述的短碼或模板標籤來生成獨特的複本。

外掛也支援嵌套的 spintax,例如 {phrase 1|phrase 2|{sub-phrase 1|sub-phrase 2|sub-phrase 3}}。

示例1:

短碼:

[wpts_spin]{phrase 1|phrase 2|phrase 3}[/wpts_spin]

函數:

<?php wpts_spin('{phrase 1|phrase 2|phrase 3}'); ?>

例子輸出:

phrase 1
phrase 2
phrase 3

示例2(嵌套的 spintax):

短碼:

[wpts_spin]{phrase 1|phrase 2|{sub-phrase 1|sub-phrase 2|sub-phrase 3}}[/wpts_spin]

函數:

<?php wpts_spin( '{phrase 1|phrase 2|{sub-phrase 1|sub-phrase 2|sub-phrase 3}}' ); ?>

例子輸出:

phrase 1
sub-phrase 2

示例3(快取):

短碼:

[wpts_spin cache="604800"]{phrase 1|phrase 2|phrase 3}[/wpts_spin]

函數:

<?php wpts_spin( '{phrase 1|phrase 2|phrase 3}', array( 'cache' => '604800' ) ); ?>

例子輸出:

與示例1相同,但輸出會被快取一周(604800秒)。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.3.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Text Spinner」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This tiny plugin allows you to use spintax like {phrase 1|phrase 2|phrase 3} in your posts, pages and theme files. Just enclose the content that you want to be processed in the shortcode [wpts_spin][/wpts_spin] and a unique copy will be generated on each page load. Alternatively, you can pass the spintax string to the function wpts_spin() and echo the returned value.
The plugin can help you avoid duplicate content penalties. For instance if you have a sizable block of text that needs to appear throughout the website then you can write spintax for it and use the above-mentioned shortcode or template tag to generate unique copies.
Nested spintax like {phrase 1|phrase 2|{sub-phrase 1|sub-phrase 2|sub-phrase 3}} is also supported by the plugin.
Example 1:
Shortcode:
[wpts_spin]{phrase 1|phrase 2|phrase 3}[/wpts_spin]

Function:

Sample Output:

phrase 1
phrase 2
phrase 3

Example 2 (Nested Spintax):
Shortcode:
[wpts_spin]{phrase 1|phrase 2|{sub-phrase 1|sub-phrase 2|sub-phrase 3}}[/wpts_spin]

Function:

Sample Output:

phrase 1
sub-phrase 2

Example 3 (Caching):
Shortcode:
[wpts_spin cache="604800"]{phrase 1|phrase 2|phrase 3}[/wpts_spin]

Function:
'604800' ) ); ?>

Sample Output:
Same as Example 1 but the output will be cached for a week (604800 seconds).

延伸相關外掛

文章
Filter
Apply Filters
Mastodon