[WordPress] 外掛分享: Shortcodes

前言介紹

  • 這款 WordPress 外掛「Shortcodes」是 2017-09-25 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2017-10-05,距離現在已有 2768 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

dineshc |

外掛標籤

wp shortcodes | meta shortcode. | option shortcode | WordPress Shortcodes |

內容簡介

這個 WordPress 外掛提供了簡潔的代碼,使用短代碼取得 WordPress 核心資料,如取得選項、取得文章中的自訂欄位、取得自訂文章型別中的自訂欄位等等。
以下是短代碼的使用方式:

[wp_get_option]
例如:[wp_get_option option=’blogname’]

[wp_get_post_meta]
例如:[wp_get_post_meta key=’your-meta-field’ single=true]

[wp_get_metadata]
例如:[wp_get_metadata meta_type=’comment’ meta_key=’your-meta-field’ single=true]

[wp_get_the_thumbnail]
例如:[wp_get_the_thumbnail]

短代碼作為另一個短代碼的參數使用。
例如:[wp_get_the_post_thumbnail post={{wp_get_the_ID}} size=”medium”]
「wp_get_the_ID」是一個取得當前文章 ID 的短代碼,並且把取得的文章 ID 傳遞到「wp_get_the_post_thumbnail」短代碼的 post 參數內。若要將短代碼作為參數的值傳遞,就需要使用 {{短代碼}} 的語法,而非 [短代碼] 的語法。

原文外掛簡介

Shortcodes providing WordPress core shortcode for get option, get post meta, get custom post meta and other WordPress data using shortcode.
Shortcodes:

[wp_get_option]
Ex. [wp_get_option option=’blogname’]

[wp_get_post_meta]
Ex. [wp_get_post_meta key=’your-meta-field’ single=true]

[wp_get_metadata]
Ex. [wp_get_metadata meta_type=’comment’ meta_key=’your-meta-field’ single=true]

[wp_get_the_thumbnail]
Ex. [wp_get_the_thumbnail]

Use of shortcode as parameter of another shortcode.
Ex. [wp_get_the_post_thumbnail post={{wp_get_the_ID}} size=”medium” ]
“wp_get_the_ID” is a shortcode to get current post id which is is passed to post parameter of “wp_get_the_post_thumbnail” shortcode. To pass shortcode as parameter value you need to use {{shortcode}} syntax instead of [shortcode].

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Shortcodes」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Mastodon