前言介紹
- 這款 WordPress 外掛「CC Child Pages」是 2014-10-19 上架。
- 目前有 10000 個安裝啟用數。
- 上一次更新是 2025-01-20,距離現在已有 103 天。
- 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.4 以上。
- 有 48 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
subpages | shortcode | sub pages | child pages |
內容簡介
CC Child Pages 是一個簡單的外掛,透過短碼顯示子頁面的連結。
子頁面以響應式盒子顯示,包含頁面標題、摘要和「閱讀更多」鏈接。
您可以選擇 1、2、3 和 4 欄的佈局。
在小型裝置上,3 和 4 欄將自動調整為 2 欄,以確保讀取性。
CC Child Pages 編輯器按鈕
CC Child Pages 現在在 WordPress 文本編輯器中添加一個按鈕,使您可以快速插入短碼並選擇許多常用選項。
CC Child Pages 小工具
CC Child Pages 還包括一個小工具,可在側欄中顯示子頁面。
小工具可以設置為顯示當前頁面或特定頁面的子代,或者顯示所有頁面。
頁面可以按菜單順序、標題或 ID 排序。您還可以選擇要顯示的頁面深度。
您現在還可以勾選選框以顯示所有頁面,在這種情況下,小工具將與標准頁面小工具的行為相似,但具有更多選項。
使用短碼
最簡單的使用方法是使用沒有參數的短碼:
[child_pages]
這會以 2 欄顯示當前頁面的子頁面。
您可以添加 cols 參數以選擇列數:
[child_pages cols="1"]
[child_pages cols="2"]
[child_pages cols="3"]
[child_pages cols="4"]
如果 cols 設置為 1、2、3 或 4 以外的任何值,則忽略該值。
您還可以通過添加頁面的 ID 顯示特定頁面的子頁面:
[child_pages id="42"]
或者您可以在逗號分隔的列表中指定多個 ID(在使用 list="true" 時不起作用)
[child_pages id="42,53,76"]
要排除頁面,請使用 exclude 參數。這允許您指定要從短碼輸出中排除的頁面 ID 的逗號分隔列表。
[child_pages exclude="5,33,45"]
要僅顯示特定頁面,可以使用 page_ids 參數。這個參數接受逗號分隔的 ID 列表。如果使用了這個參數,id 和 exclude 參數將被忽略。
[child_pages page_ids="3,7,10,35"]
以上代碼將僅顯示列出的頁面。
如果您想使用除標准「閱讀更多 …」外的其他文本來鏈接到子頁面,可以使用 more 參數指定:
[child_pages more="More..."]
您也可以將「閱讀更多 …」鏈接完全隱藏,方法是將 hide_more 參數設置為 "true":
[child_pages hide_more="true"]
由於沒有其他方法讓訪客鏈接到子頁面,因此您可以選擇通過將 link_titles 參數設置為 "true" 來使頁面標題鏈接到子頁面:
[child_pages link_titles="true"]
(這主要是設計用於與 hide_more 參數一起使用,但如果您想讓標題和「閱讀更多 …」文本都鏈接到子頁面,則可以獨立使用。)
當指定 link_titles="true" 時,您可能希望對鏈接應用自己的樣式。要這樣做,可以使用 title_link_class 參數指定樣式:
[child_pages link_titles="true" title_
原文外掛簡介
CC Child Pages is a simple plugin to show links to child pages via a shortcode.
Child Pages are displayed in responsive boxes, and include the page title, an excerpt and a “Read more…” link.
You can choose between 1, 2, 3 & 4 column layouts.
3 & 4 column layouts will resize to a 2 column layout on small devices to ensure that they remain readable.
CC Child Pages editor button
CC Child Pages now adds a button to the WordPress text editor, allowing you to quickly insert the shortcode and select many common options
CC Child Pages widget
CC Child Pages also includes a widget for displaying child pages within your sidebars.
The widget can be set to show the children of the current page or a specific page, or to show all pages.
Pages can be sorted by their menu order, title or ID. You can also select the depth of pages to be displayed.
You can now also tick the checkbox to show all pages, in which case the widget will behave much like the standard Pages widget but with additional options.
Using the shortcode
The simplest usage would be to use the shortcode with no parameters:
[child_pages]
This would show the Child Pages for the current page in 2 columns.
You can add the cols parameter to choose the number of columns:
[child_pages cols="1"]
[child_pages cols="2"]
[child_pages cols="3"]
[child_pages cols="4"]
… if cols is set to anything other than 1, 2, 3 or 4 the value will be ignored.
You can also show the child pages of a specific page by adding the ID of the page as follows:
[child_pages id="42"]
… or you can specify multiple IDs in a comma-separated list (does not work when using list="true")
[child_pages id="42,53,76"]
To exclude pages, use the exclude parameter. This allows you to specify a comma separated list of Page IDs to be exclude from the output of the shortcode.
[child_pages exclude="5,33,45"]
To display only specific pages, you can use the page_ids paremeter. This accepts a comma separated list of IDs. If this parameter is used, the id and exclude parameters are ignored.
[child_pages page_ids="3,7,10,35"]
The above code will display only the listed pages.
If you want to prefer to use text other than the standard “Read more …” to link to the pages, this can be specified with the more parameter:
[child_pages more="More..."]
You may also hide the “Read more …” link altogether by setting the hide_more parameter to "true":
[child_pages hide_more="true"]
Since there is no other way for the visitor to link to the child page, you can choose to make the page titles link to the child page by setting the link_titles parameter to "true":
[child_pages link_titles="true"]
(This is mainly designed to be used with the hide_more parameter, but can be used independently if you want to have both the titles and “Read more …” text link to the child page.)
When specifying link_titles="true", you may wish to apply your own styling to the links. To do so, you can specify a style using the title_link_class parameter:
[child_pages link_titles="true" title_link_class="my_title_link_class"]
You may also hide the titles altogether by setting the hide_title parameter to "true":
[child_pages hide_title="true"]
You can display a thumbnail of the featured image for each page (if set) by setting the thumbs parameter to "true":
[child_pages thumbs="true"]
You can now also display thumbnails at different sizes to the default (‘medium’) size. Simply specify the thumbnail size in the thumbs parameter. You can even specify custom image sizes.
[child_pages thumbs='large']
You can make thumbnails link to the related child page by setting the link_thumbs to "true":
[child_pages thumbs='large' link_thumbs="true"]
… note that specifying the link_thumbs parameter will have no effect unless the thumbs parameter is set to either true or a thumbnail size.
You can specify a target for the links added by the plugin by setting the link_target parameter. This will work exactly the same as setting the target parameter for the HTML tag:
[child_pages link_target="_blank"]
You can limit the length of the excerpt by specifying the words parameter:
[child_pages words="10"]
You can hide the excerpt altogether by setting the hide_excerpt parameter to "true":
[child_pages hide_excerpt="true"]
You can stop Custom Excerpts from being truncated by setting the truncate_excerpt parameter to “false”:
[child_pages truncate_excerpt="false"]
… this will display custom excerpts exactly as entered without being shortened. (Especially useful if using the Rich Text Excerpts plugin, in which case all styling will be preserved.)
When truncate_excerpt is set to true, excerpts will be truncated only if they exceed the specified word count (default 55). When custom excerpts are truncated, any HTML will be removed.
If you have inserted more tags into your posts/pages, you may find that the Continue reading message is included in the excerpt. To hide this, set the hide_wp_more parameter to true:
[child_pages hide_wp_more="true"]
IF you wish to display the full contents of the listed pages, you can set the show_page_content parameter to true:
[child_pages show_page_content="true"]
To change the order in which the child pages are listed, you can use the orderby and order parameters:
[child_pages orderby="title" order="ASC"]
The orderby parameter can have one of the following values:
menu_order (the default value) – shows the pages sorted by the order in which they appear within the WordPress admin
id sorts the pages according to the ID of the page
title sorts the pages alphabetically by the title
slug sorts the pages alphabetically according to the slug (page_name) of the page
author sorts the pages by author
date sorts the pages by the date they were created
modified sorts the pages by the date they were modified
rand shows the pages in a random order
The order parameter can be set to:
ASC shows the pages in ascending order, sorted by the value of `orderby`
DESC shows the pages in descending order, sorted by the value of `orderby`
You can now also use the skin parameter to choose a colour scheme for the Child Pages as follows:
[child_pages skin="simple"] (the default colour scheme)
[child_pages skin="red"]
[child_pages skin="green"]
[child_pages skin="blue"]
If you want to style the child page boxes yourself, you can also specify the class parameter. If used, this overrides the span parameter and adds the specified class name to the generated HTML:
[child_pages class="myclass"]
If you are not using the provided skins, you can prevent the CSS file for the skins from being loaded from the CC Child Pages options under the Settings menu.
Finally, you can also display just an unordered list (
- ) of child pages by adding the list parameter. In this case, all other parameters are ignored except for class, cols, exclude, orderby, order and id.
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「CC Child Pages」來進行安裝。
Child Pages Block 》這個 WordPress 外掛產生一個 Gutenberg 區塊,顯示所選父頁面的子頁面列表。。
Child pages 》Child Pages Widget 可以自動顯示當前頁面的子頁面。如果當前頁面沒有子頁面,則該小工具將不可見。, 您還可以將 CSS 類添加到
- 標籤,以匹配小工...。
Summary Page 》列出、或包含子頁面與元選項。, 安裝並啟用外掛後,為頁面添加自訂欄位(元)「is_summary」,並將其設置為 1 以啟用顯示該頁面本身後的所有非級聯子頁面。。
[child_pages list="true"]
When using the list parameter, you can also specify the depth parameter to specify how many levels in the hierarchy of pages are to be included in the list.
The depth parameter accepts the following values:
0 (default) Displays pages at any depth and arranges them hierarchically in nested lists
-1 Displays pages at any depth and arranges them in a single, flat list
1 Displays top-level Pages only
2, 3 … Displays Pages to the given depth
[child_pages list=”true” depth=”4″]
Specifying the cols parameter with list="true" will show the child pages as an unordered list ordered into a number of columns (I would recommend avoiding the use of the depth parameter when listing child pages within columns – the results are likely to be fairly unreadable!).
[child_pages list="true" cols="3"]
The columns are responsive, and should adjust according to the browser being re-sized or the size of the screen being used.
N.B. Because the shortcode uses the WordPress wp_list_pages function to output the list, columns are acheived by applying CSS styling to the functions standard output. This CSS should work fine in modern browsers, but in older browsers (such as Internet Explorer 8) the list will not be split into columns
The depth parameter can now also be used with the shortcode when list is not set or is is set to "false".
If depth is set, the sub-pages for each child page will be shown as an ordered list. You can specify a title for this element by setting the subpage_title parameter:
[child_pages depth="3" subpage_title="Sub-pages"]
Private Pages
By default the shortcode (as of verion 1.36) will show pages that have their visibility set to publish, with pages with a visibility of private added for logged in users that have access to these pages.
You can specify which pages to show by using the post_status parameter, which can take the following values:
publish – published, publicly viewable pages
pending – pages which are pending review
draft – pages which have not yet been published and have the draft status
auto-draft – newly created pages with no content
future – pages with the publish date set in the future
private – pages which are not visible to users who are not logged in
inherit – revisions
trash – pages which have been moved to the trash awaiting deletion
any – pages with any status except those from post statuses with ‘exclude_from_search’ set to true (i.e. trash and auto-draft)
Some of these values are unlikely to be helpful in everyday use.
For example:
[child_pages post_status="publish"]
To specify a number of statuses, provide a comma-separated list:
[child_pages post_status="publish,private"]
Post Meta
You can show the author, date created and/or date modified for a post by using show_author, show_date_created and show_date_modified parameters. If set to true, they will show the corresponding information:
[child_pages show_author="true" show_date_created="true"]
Sibling Pages
The shortcode also allows you to display sibling pages (those at the same level as the current page within the hierarchy).
To do this, set the siblings parameter to true.
This will override the id parameter and will append the current page to the exclude parameter.
[child_pages siblings="true"]
This can also be used with the list parameter
[child_pages siblings="true" list="true"]
By default, the shortcode will not display the current page when siblings is set to true. If you wish to include the current page, set the show_current_page parameter to true:
[child_pages siblings="true" show_current_page="true"]
[child_pages siblings="true" list="true" show_current_page="true"]
Limits
You can limit the number of child pages displayed using the limit parameter (unless the list parameter has been set to "true").
For example:
[child_pages limit="5"] will display only the first 5 child pages.
Offset
When not using list="true", you can specify a value for offset to skip a set number of results. For example:
[child_pages offset="2"]
… will skip the first 2 pages.
Custom Fields
You may wish to show a different title, excerpt, “Read more…” message or thumbnail on certain pages. To achieve this, you can set values in custom fields on specific pages – to tell the shortcode to use the custom value, set the use_custom_excerpt, use_custom_title, use_custom_more or use_custom_thumbs parameter to the name of the custom field to be used.
If the field used is set for a page, its value will be used instead of the default excerpt/title/”Read more…”. Pages on which the custom field is not populated will use the default value.
[child_pages use_custom_excerpt="custom_cc_excerpt"]
… will replace the standard excerpt with the value of the custom field custom_cc_excerpt (if it is set)
[child_pages use_custom_title="custom_cc_title"]
… will replace the standard title with the value of the custom field custom_cc_title (if it is set)
[child_pages use_custom_thumbs="custom_cc_thumnail"]
… will replace the standard thumbnail with one specified in the value of the custom field custom_cc_thumnail (if it is set). The value of the custom_cc_thumnail custom field can either be set to the ID of the image attachment (using the Advanced Custom Fields plugin can make this much easier to use) or to the full URL of the image.
[child_pages use_custom_more="custom_cc_more"]
… will replace the standard “Read more…” message with the value of the custom field custom_cc_more (if it is set)
[child_pages use_custom_link="custom_cc_link"]
… will replace URL link for the page with the URL specified in the value of the custom field custom_cc_link (if it is set). (The default value of use_custom_link is "cc_child_pages_link", so that this field can be set without the need to specify the parameter. To disable this functionality, set use_custom_link="".)
[child_pages use_custom_link_target="custom_cc_link_target"]
… will replace the link target for titles, thumbnails and the “Read more…” text with the value specified in the custom field custom_cc_link_target (if it is set). (The default value of use_custom_link_target is "cc_child_pages_link_target", so that this field can be set without the need to specify the parameter. To disable this functionality, set use_custom_link_target="".)
N.B. use_custom_excerpt, use_custom_title, use_custom_more, use_custom_link use_custom_link_target and use_custom_thumbs will not work when list="true"
Pagination
CC Child Pages now includes basic support for pagination.
You can set the number of child pages to be displayed on each page by specifying the posts_per_page parameter, e.g.:
[child_pages posts_per_page="6"]
The above code will display 6 child pages on each page, and if there are more than 6 child pages found navigation links will be displayed.
You can also specify the page parameter to display a specific page. For example:
[child_pages posts_per_page="3" page="2"]
The above code will show the second page of results (item 4 onwards, up to 3 items). N.B. when the page parameter is specified, no pagination links are displayed.
The page parameter has no effect unless posts_per_page is specified.
Pagination functionality is limited on a static front page
N.B. The pagination parameters are ignored when list="true"
Sticky Posts
By default, sticky posts are not shown … however, if you want them to be displayed you can set the ignore_sticky_posts parameter to be false:
[child_pages ignore_sticky_posts="false"]
各版本下載點
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.9 | 1.10 | 1.11 | 1.12 | 1.13 | 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 | 1.25 | 1.26 | 1.27 | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 | 1.33 | 1.34 | 1.35 | 1.36 | 1.37 | 1.38 | 1.39 | 1.40 | 1.41 | 1.42 | 1.43 | 1.44 | 1.45 | trunk |
延伸相關外掛(你可能也想知道)