內容簡介
這個外掛讓頁面作者可以通過使用新的 [childpages] 短碼,輕鬆地列出指定頁面的任何子頁面。 使用短碼 [childpages] 會返回一個基本的子頁面列表,該列表為您正在編輯的頁面的子頁面。 作為 Usage 部分所述的更複雜版本的短碼會給您更多控制輸出結果的選項。
使用方法
獲取頁面列表的基本短碼為 [childpages]。 不論何時您需要放置當前正在編輯的頁面的子頁面列表,只需在可視化或 HTML 編輯器中輸入該代碼即可。 結果顯示的列表不會顯示標題,一級深度,不排除任何子頁面或作者,按頁面順序排序,然後按標題排序。
要列出帶有標題的子頁面,請使用短碼的封套形式,如下所示:
[childpages]列表標題[/childpages]
開始和結束短碼之間的文本將是所得列表的標題,它正被傳遞到 wp_list_pages() 模板標記的 title_li 屬性中。
要更改用於格式化列表的默認值,請在您的短碼中傳遞相應的參數,如下所示:
[childpages depth=2 sort_column=ID]
您提供的參數傳遞給 wp_list_pages()。 支持以下參數; 有關這些參數的使用詳細信息可以在 WordPress Codex 中找到。
depth
child_of
exclude
echo
authors
sort_column
有關更多信息,請訪問該插件的主頁 http://scottierocket.com/wordpress-stuff/sr-childpages。
外掛標籤
開發者團隊
原文外掛簡介
This plugin allows page authors to easily list any child pages of a given page by simply using a new [childpages] shortcode. A basic list of the children to the page you’re editing will be returned with the shortcode [childpages]. More-complex versions of the shortcode, as described in the Usage section, give you additional control over the output results.
Usage
The basic shortcode to get a page list is [childpages]. Wherever you have a need to drop of a list of child pages for the page you’re currently authoring, just enter that code in either the Visual or HTML editor. The list that results will not be shown with a title, will be one level deep, will not exclude any child pages or authors, and will be sorted by page order and then by title.
To list the child pages with a title, use the enclosing form of the shortcode, like this:
[childpages]List Title[/childpages]
The text between the opening and closing shortcodes will be the title of the resulting list. It is being passed to the title_li attribute in the wp_list_pages() template tag.
To change the defaults used to format the list, pass the appropriate parameters in your shortcode, like this:
[childpages depth=2 sort_column=ID]
The parameters you provide are passed to wp_list_pages(). The following parameters are supported; usage details for these parameters can be found in the WordPress Codex.
depth
child_of
exclude
echo
authors
sort_column
For more information, visit the plugin’s home page at http://scottierocket.com/wordpress-stuff/sr-childpages.
