[WordPress] 外掛分享: Logic Shortcodes

首頁外掛目錄 › Logic Shortcodes
10+
安裝啟用
尚無評分
3610 天前
最後更新
問題解決
WordPress 2.5.0+ v1.0 上架:2016-04-18

內容簡介

這個外掛讓你可以使用 [if] 簡碼來進行條件邏輯判斷,判斷依據可以是帖子或頁面上的分類或標注詞的存在情況。

如果您願意,請考慮花一分鐘評價這個外掛或讓我知道您的任何功能要求。謝謝!

標注詞

對於標注詞的條件邏輯,您可以使用標注詞的名稱、縮略名或者標識 ID:

[if taxonomy=”category” slug=”cars”]要展示的內容[/if]
[if taxonomy=”category” name=”Cars”]要展示的內容[/if]
[if taxonomy=”category” id=”123″]要展示的內容[/if]

帖子元數據

可以使用帖子元數據(或自定義欄位)邏輯來檢查是否存在某個特定的 meta_key 和 meta_value 組合或只有 meta_key:

[if postmeta=”car_model”]如果汽車型號信息存在,則顯示的內容[/if]
[if postmeta=”car_model” value=”Tesla Model S”]如果汽車型號為特斯拉 Model S,則顯示的內容[/if]

外掛標籤

開發者團隊

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

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

原文外掛簡介

This plugin enables the use of [if] shortcodes to work with conditional logic based on the existence of post meta or taxonomy terms on posts and pages.
Please consider taking a minute to rate the plugin or let me know any feature request. Thanks!
Taxonomy
With conditional logic for taxonomy terms, you can use names, slugs or term_ids:

[if taxonomy=”category” slug=”cars”]Content to show[/if]
[if taxonomy=”category” name=”Cars”]Content to show[/if]
[if taxonomy=”category” id=”123″]Content to show[/if]

Post Meta
Post meta (or custom field) logic can be used to check if a certain meta_key AND meta_value combination are present or just a meta_key:

[if postmeta=”car_model”]Content to show if car model info is present[/if]
[if postmeta=”car_model” value=”Tesla Model S”]Content to show if car model is Tesla Model S[/if]

延伸相關外掛

文章
Filter
Apply Filters
Mastodon