[WordPress] 外掛分享: Current Post Shortcode

首頁外掛目錄 › Current Post Shortcode
WordPress 外掛 Current Post Shortcode 的封面圖片
30+
安裝啟用
尚無評分
89 天前
最後更新
問題解決
WordPress 6.7+ PHP 7.4+ v3.1.0 上架:2025-03-11

內容簡介

總結:這個「Current Post Shortcode」外掛讓你可以使用簡單的短代碼來顯示文章標題和自訂欄位數值。你可以顯示目前文章的標題或元資訊,或指定文章ID來擷取特定文章的資料。

問題與答案:
1. 使用「Current Post Shortcode」外掛可以做什麼?
使用簡單的短代碼來顯示文章標題和自訂欄位數值。
2. 如何顯示目前文章的標題?
使用 [current_post] 這個短代碼。
3. 如何顯示目前文章的元資訊(自訂欄位)?
使用 [current_post meta="custom_field"] 這個短代碼。
4. 如何從特定文章ID擷取資料?
使用 [current_post id="123"] 這個短代碼。

外掛標籤

開發者團隊

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

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

原文外掛簡介

The “Current Post Shortcode” plugin allows you to display post titles and custom field values using simple shortcodes. You can display the current post’s title or meta information, or specify a post ID to retrieve data from a specific post.
Display Current Post Title and Meta Information:

Post Title: [current_post] → Outputs the current post title, e.g., “Hello World”
Post Meta (Custom Field): [current_post meta="custom_field"] → Outputs the value of the custom field

Display Data from a Specific Post ID:

Post Title: [current_post id="123"] → Outputs the title of the post with ID “123”
Post Meta (Custom Field): [current_post id="123" meta="custom_field"] → Outputs the value of the custom field in the post with ID “123”

Display Fallback Meta Value:
[current_post meta="custom_field" default="Default Value"] → Displays "Default Value" if the custom field is empty

Display Default Value for Zero Meta Value:
[current_post meta="custom_field" default="Default Value" skip="true"] → Displays "Default Value" if the custom field value is zero

延伸相關外掛

文章
Filter
Apply Filters
Mastodon