前言介紹
- 這款 WordPress 外掛「Child Pages Shortcode」是 2011-10-10 上架。
- 目前有 6000 個安裝啟用數。
- 上一次更新是 2017-11-28,距離現在已有 2715 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.8 以上版本才可以安裝。
- 有 20 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
miyauchi |
外掛標籤
內容簡介
您可以使用簡短代碼來從頁面中顯示子頁面。
此外掛在 GitHub 上維護。
一些功能
此外掛將添加簡碼[child_pages]顯示子頁面。
您可以自定義插件上的默認HTML模板。
此外掛將能夠對頁面進行“節錄”。
範例
顯示當前頁面的子頁面。
[child_pages width=”33%”]
引數
id - 頁面ID(可選)
size - 文章縮略圖大小,例如“縮略圖”或“大”
width - 子頁面塊的寬度。
disable_shortcode - 如果設為 true,則簡碼在模板中不起作用。
disable_excerpt_filters - 如果設為 true,則節選的過濾器不起作用。
篩選器 hooks 範例
用於 query_posts() 查詢的篩選器。
//默認引數
$args = array(
'post_status' => 'publish',
'post_type' => 'page',
'post_parent' => $id_for_the_post,
'orderby' => 'menu_order',
'order' => 'ASC',
'nopaging' => true,
);
add_filters('child-pages-shortcode-query', "my_query");
function my_query($args) {
//
//某些代碼在此
//
return $args;
}
?>
用於默認模板的篩選器。
add_filter("child-pages-shortcode-template", "my_template");
function my_template($template) {
return '
}
?>
用於樣式表 URI 的篩選器。
add_filter("child-pages-shortcode-stylesheet", "my_style");
function my_style($url) {
return 'http://example.com/path/to/style.css';
}
?>
默認模板
模板變數
%post_id% - 頁面的 ID
%width% - 單個頁面的塊的寬度
%post_url% - 頁面固定鏈接
%post_thumb% - 文章縮略圖
%post_title% - 頁面標題
%post_excerpt% - 頁面節錄
支援
http://wpist.me/wp/child-pages-shortcode/(英文)
http://firegoby.theta.ne.jp/wp/child-pages-shortcode(日文)
貢獻者
Takayuki Miyauchi
學分
使用本插件不保證,但無論用途如何,WordPress 的用戶可以免費使用此插件。
作者必須事先承認在使用此插件時不保證操作保證和支援。
聯繫
http://wpist.me/
原文外掛簡介
You can use shortcode for display child pages from the page.
This plugin maintained on GitHub.
Some features
This plugin will add shortcode [child_pages] display child pages.
You can customize default HTML template on your plugin.
This plugin will be able to “excerpt” to the pages.
Example
Display child pages of the current page.
[child_pages width=”33%”]
Args
id – ID of page (Optional)
size – Post thumbnail size. e.g. ‘thumbnail’ or ‘large’
width – width of block for child pages.
disable_shortcode – Shortcode not work in the template if set true.
disable_excerpt_filters – filters not work for the excerpt if set true.
filter hooks example
Filter for query_posts() query.
'publish',
'post_type' => 'page',
'post_parent' => $id_for_the_post,
'orderby' => 'menu_order',
'order' => 'ASC',
'nopaging' => true,
);
add_filters('child-pages-shortcode-query', "my_query");
function my_query($args) {
//
// some code here
//
return $args;
}
?>
Filter for default template.
%post_thumb%