Skip to content

Page List: Add parent parameter to show all child pages of current page #31063

@mkaz

Description

@mkaz

What problem does this address?

The goal is to allow a page to create a menu/list of posts of all the children page, sorted by menu_order.

The solution in PHP could something like this:

$args = array(
    'post_type'      => 'page',
    'posts_per_page' => -1,
    'post_parent'    => $parent_id,
    'orderby'        => 'menu_order',
    'order'          => 'ASC',
 );

$child_pages = new WP_Query( $args );

An issue with pages is there is no means to add additional tag or category information as another means of limiting what is returned by the query.

Possible this should just be added to: #24934

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions