
前言介紹
- 這款 WordPress 外掛「Post Content Shortcode」是 2025-06-28 上架。
- 目前有 30 個安裝啟用數。
- 上一次更新是 2025-06-29,距離現在已有 242 天。
- 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.0 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
shortcode | post content | Content Blocks | dynamic content | reusable content |
內容簡介
總結:
Post Content Shortcode 外掛允許您使用 shortcode 顯示任何文章的內容。這對於在多個位置重複使用內容、內嵌其他文章或包含動態更新的內容塊非常有用。您可以從外掛的設置頁面在「設置 → Post Content Shortcode」下配置允許使用的文章狀態。
問題與答案:
1. Post Content Shortcode 外掛的主要功能是什麼?
- 回答:允許使用 shortcode 顯示任何文章的內容。
2. 如何使用 shortcode 嵌入特定文章的內容?
- 回答:在文章中使用以下格式的 shortcode:[post_content id="文章ID"]。將「文章ID」替換為您想要嵌入的文章的ID。
3. 如何避免文章內容之間的無限迴圈?
- 回答:外掛會防止一篇文章包含自身,從而避免無限迴圈。
4. 如何自訂 shortcode 標籤?
- 回答:您可以在主題的 functions.php 檔案中添加代碼來更改 shortcode 標籤,例如 add_filter('herron_pcs_shortcode_tag', function( $tag ) { return 'my_custom_shortcode'; });。更改後,使用新標籤 [my_custom_shortcode id="文章ID"]。設置頁面和邏輯將自動尊重這個更改。
原文外掛簡介
Post Content Shortcode allows you to display the content of any post using a shortcode like:
[post_content id=”123″]
This is useful for reusing content in multiple places, referencing another post inline, or including dynamically updated blocks of content.
You can configure which post statuses are allowed to be embedded from the plugin’s settings page under Settings → Post Content Shortcode.
Usage
Use the shortcode like this:
[post_content id=”123″]
Where 123 is the ID of the post you want to embed.
To avoid infinite loops, the plugin prevents a post from including itself.
Only posts with selected statuses (e.g. Published, Draft) will be rendered. You can control this from the plugin settings page.
Customizing the Shortcode Tag
By default, the shortcode tag is post_content. You can change it by adding this to your theme’s functions.php file:
add_filter( ‘herron_pcs_shortcode_tag’, function( $tag ) {
return ‘my_custom_shortcode’;
});
After doing so, use the new tag:
[my_custom_shortcode id=”123″]
The settings page and all logic will automatically respect this change.
Learn More About Herron
This plugin is part of Herron’s ongoing effort to give back to the WordPress community. If you’re interested in how we build custom WordPress solutions for clients or want to collaborate, please visit https://herron.agency/.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Post Content Shortcode」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Dev Content Blocks 》不只適用於開發人員。, 創建可重複使用的全局內容的內容模塊。支持版本控制。帶有原始 HTML、JS 和 CSS 的輸入字段,而不必擔心自動格式化,同時還可以使用通...。
Snap Blocks 》### 總結:, Snap Blocks 是一個輕量的外掛程式,讓您可以在 WordPress 中建立可重複使用的內容區塊。每個區塊都是自己的貼文,可以使用免費版本的 Elementor ...。
Pillar Press – Content Blocks for Gutenberg 》Pillar Press 的 Content Blocks 外掛為新的Gutenberg 區塊編輯器提供自訂區塊。, 請注意:Content Blocks 仍在積極開發中,使用於正式網站風險自負。, 由於...。
