內容簡介
CompositePost 可讓您將文章/頁面嵌入其他文章/頁面。
用法
在文章的任何地方寫下:
[composite option=”value”]
您可以指定一個或多個選項。這些選項與 get_posts() 函數中使用的選項相同(請參閱 https://codex.wordpress.org/Template_Tags/get_posts)。
範例
顯示從「Projects」類別中的所有文章,並包括 ID 為1的文章:
[composite category_name=”Projects” include=”1″]
範本
CompositePost 會使用位於外掛資料夾中的範本建立迴圈(通常是 /wordpress/wp-content/plugins/composite_post)。預設範本是 /wordpress/wp-content/plugins/composite_post/default.php。您可以擁有任意數量的範本,只需指定使用哪一個,如下所示:
[composite category_name=”Projects” template=”my_template”]
CompositePost 會在 /wordpress/wp-content/plugins/composite_post/my_template.php 尋找該檔案。
外掛標籤
開發者團隊
原文外掛簡介
CompositePost let’s you insert posts/pages inside other posts/pages.
Usage
Write anywhere on a post:
[composite option=”value”]
You can specify one or more options. The options are the same used in the get_posts() function (see https://codex.wordpress.org/Template_Tags/get_posts).
Example
Show all posts from category Projects and include post with ID = 1:
[composite category_name=”Projects” include=”1″]
Templates
CompositePost create a loop using a template located in the plugin’s folder (usually /wordpress/wp-content/plugins/composite_post). The default template is /wordpress/wp-content/plugins/composite_post/default.php. You can have as many templates as you want, just specify wich one to use, like this:
[composite category_name=”Projects” template=”my_template”]
CompositePost will look for the file at /wordpress/wp-content/plugins/composite_post/my_template.php
