| 开发者 | douglaskarr |
|---|---|
| 更新时间 | 2026年11月26日 05:00 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[listchildpages] shortcode that lists the child pages of the current page, or of any page you choose, as a simple linked list. Each item can show the page's featured image and excerpt.
[listchildpages]...[/listchildpages]. [dknm_list_child_pages] works the same way. It accepts several attributes:
ASC or DESC. Default: DESC, or ASC when orderby="menu_order".publish_date (maps to date). Also accepts published (maps to date), title, name, modified, menu_order, ID, rand, type, and author. Use menu_order to follow the Order numbers set under Page Attributes; pages with the same number sort by title.yes|no). Also accepts y, true, 1, and on. Default: no.alignleft, alignright, etc.).current to choose the parent page. Default: current.thumbnail, medium, large, full, or custom size). Default: thumbnail.dknm_lcp_html – filter the final HTML. Receives the HTML, the parent page ID, and the normalized attributes.shortcode_atts_listchildpages – the standard WordPress filter for the shortcode's attributes.dklcp/listchildpages/html – the 1.x output filter. It still runs but is deprecated; use dknm_lcp_html.list-child-pages-shortcode folder to /wp-content/plugins/.[listchildpages] where the list should appear.Edit the child page and you'll find an excerpt section where you can enter a description that will be published on the list.
Within your functions.php file, look for the add_theme_support post-thumbnails line and add page to the array. Or if you don't have that line, you can just add it:
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
There are additional class fields for the unordered list tag (ulclass), list item tag (liclass), and the anchor tag (aclass). You can modify the output utilizing your theme's CSS.
Set the Order number under Page Attributes on each child page (1, 2, 3...), then use [listchildpages orderby="menu_order"]. Since 1.6.0 this sorts lowest number first. Add order="desc" to reverse it.
No. [listchildpages] and every attribute work as before. The only change in output is that orderby="menu_order" without an order attribute now sorts ascending, which matches the order shown in WordPress.
The plugin stores nothing in the database. An uninstall.php file defensively removes any leftover dknm_lcp_ or legacy dklcp_ options or transients if they were ever created. Your pages, excerpts, and featured images are not changed. Shortcodes left in content will simply stop rendering until the plugin is activated again.
[listchildpages] shortcode are unchanged.orderby="menu_order" now sorts ascending (the Page Attributes order) when no order is given, with title as a tie-breaker for pages that share a number.[dknm_list_child_pages] alias for the shortcode.dknm_lcp_html output filter. The 1.x dklcp/listchildpages/html filter still runs and is marked deprecated.dknm_lcp_ prefix. The old dklcp_ function names remain as wrappers.orderby values (rand, type, author) and the published alias.on as a truthy displayimage value.parent attribute to target a specific parent page by ID or slug.size attribute to choose featured image size.