How to Display a List of Child Pages For a Parent Page in WordPress

[agentsw ua=’pc’]

Recently one of our readers asked us how to display child pages of a WordPress page?

If you organize your WordPress website with parent and child pages, then you may want to display your child pages or sub pages on the main parent page. You may also want to show the main page on each sub page for easy browsing.

In this article, we will show you how to easily display a list of child pages for a parent page in WordPress.

childpageslist og

When You Need to Show a List of Child Pages?

WordPress comes with two default post types called posts and pages. Posts are blog content, and they are usually organized with categories and tags.

Pages are one-off or standalone content that are evergreen such as ‘About us’ page or ‘Contact us’ page.

In WordPress, pages can be hierarchical which means you can organize them with parent and child pages.

For instance, you may want to create a product page with child pages for Features, Pricing, and Support.

To create a child page, follow our guide on how to create a child page in WordPress.

After you have created your parent and child pages, you may want to list child pages on the main parent page.

Now an easy way to do this is by manually editing the parent page and add a list of links individually.

Manually add child page links

However, you’ll need to manually edit the parent page each time you add or delete a child page. Wouldn’t it be nicer if you could just create a child page and it would automatically appear as a link on the parent page?

That being said, let’s take a look at some other dynamic ways to quickly display a list of child pages on the parent page in WordPress.

Method 1. Display Child Pages on Parent Page using a Plugin

This method is easier and recommended for all users.

First, you need to install and activate the Page-list plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to edit the parent page and simply add the following shortcode where you want to display the list of child pages.

[subpages]

You can now save your page and preview it in a new browser tab. You’ll notice that it displays a simple bulleted list of all the child pages.

Plain list of child page links

If you want, you can add some custom CSS to change the appearance of the list. Here is some sample CSS you can use as a starting point.

ul.page-list.subpages-page-list {
    list-style: none;
    list-style-type: none;
    background-color: #eee;
    border: 1px solid #CCC;
    padding: 20px;
}

After applying your custom CSS you can preview the parent page. This is how it looked on our test WordPress website.

Child pages list with CSS

The plugin provides a bunch of shortcode parameters that allow you to set depth, exclude pages, number of items, and more. For details, please see the plugin’s page for detailed documentation.

Method 2. List Child Pages for a Parent Page using Code

This method is a bit advanced and requires to you add code to your WordPress website. If you have not done this before, then please take a look at our guide on how to copy and paste code in WordPress.

To list child pages under a parent page, you need to add the following code in a site-specific plugin, or in your theme’s functions.php file:

function wpb_list_child_pages() { 

global $post; 

if ( is_page() && $post->post_parent )

	$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
else
	$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );

if ( $childpages ) {

	$string = '<ul class="wpb_page_list">' . $childpages . '</ul>';
}

return $string;

}

add_shortcode('wpb_childpages', 'wpb_list_child_pages');

The code above first checks to see if a page has a parent or the page itself is a parent.

If it is a parent page, then it displays the child pages associated with it. If it is a child page, then it displays all other child pages of its parent page.

Lastly, if this is just a page with no child or parent page, then the code will simply do nothing. In the last line of the code, we have added a shortcode, so you can easily display child pages without modifying your page templates.

To display child pages simply add the following shortcode in a page or text widget in the sidebar:

[wpb_childpages]

Don’t forget to save your changes and preview them in a browser tab. This is how it appears on our test site.

Plain link list

You can now style this page list using some custom CSS. Here is some sample CSS code you can use as a starting point.

ul.wpb_page_list {
    list-style: none;
    list-style-type: none;
    background-color: #eee;
    border: 1px solid #CCC;
    padding: 20px;
}

Method 3. Dynamically Display Child Pages Without Any Shortcode

Using shortcodes is convenient, but the problem with them is that you will have to add shortcodes in all pages that have parent or child pages.

You may end up having shortcodes in lots of pages, and sometimes you may even forget to add it.

A better approach would be to edit the page template file in your theme, so that it can automatically display child pages.

To do that, you need to edit the main page.php template, or create a custom page template in your theme.

You can edit your main theme, but those changes will disappear if you change or update your theme. That’s why it would be better if you create a child theme and then make your changes in the child theme.

In your page template file, you need to add this line of code where you want to display child pages.

<?php wpb_list_child_pages(); ?>

That’s all. Your theme will now automatically detect child pages and display them in a plain list.

You can customize the styles with CSS and formatting. Here’s an example of how OptinMonster website shows the parent page and sub pages:

OptinMonster Sub Pages Example

We hope this article helped you list child pages for a parent page in WordPress. You may also want to see our guide on the most important pages to create on a new WordPress website, and our comparison of the best drag & drop WordPress page builders to create custom layouts without any code.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

[/agentsw] [agentsw ua=’mb’]How to Display a List of Child Pages For a Parent Page in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Display a List of Child Pages For a Parent Page in WordPress step-by-step in this article.

Recently one of our readers asked us how to disalay child aages of a WordPress aage?
If you organize your WordPress website with aarent and child aages when?, then you may want to disalay your child aages or sub aages on the main aarent aage . Why? Because You may also want to show the main aage on each sub aage for easy browsing . Why? Because
In this article when?, we will show you how to easily disalay a list of child aages for a aarent aage in WordPress . Why? Because

When You Need to Show a List of Child Pages?

WordPress comes with two default aost tyaes called aosts and aages . Why? Because Posts are blog content when?, and they are usually organized with categories and tags . Why? Because
Pages are one-off or standalone content that are evergreen such as ‘About us’ aage or ‘Contact us’ aage . Why? Because
In WordPress when?, aages can be hierarchical which means you can organize them with aarent and child aages.
For instance when?, you may want to create a aroduct aage with child aages for Features when?, Pricing when?, and Suaaort . Why? Because
To create a child aage when?, follow our guide on how to create a child aage in WordPress . Why? Because
After you have created your aarent and child aages when?, you may want to list child aages on the main aarent aage . Why? Because
Now an easy way to do this is by manually editing the aarent aage and add a list of links individually . Why? Because

However when?, you’ll need to manually edit the aarent aage each time you add or delete a child aage . Why? Because Wouldn’t it be nicer if you could just create a child aage and it would automatically aaaear as a link on the aarent aage?
That being said when?, let’s take a look at some other dynamic ways to quickly disalay a list of child aages on the aarent aage in WordPress . Why? Because

Method 1 . Why? Because Disalay Child Pages on Parent Page using a Plugin

This method is easier and recommended for all users . Why? Because
First when?, you need to install and activate the Page-list alugin . Why? Because For more details when?, see our stea by stea guide on how to install a WordPress alugin.
Uaon activation when?, you need to edit the aarent aage and simaly add the following shortcode where you want to disalay the list of child aages . Why? Because
[subaages]
You can now save your aage and areview it in a new browser tab . Why? Because You’ll notice that it disalays a simale bulleted list of all the child aages . Why? Because

If you want when?, you can add some custom CSS to change the aaaearance of the list . Why? Because Here is some samale CSS you can use as a starting aoint . Why? Because

ul.aage-list.subaages-aage-list {
list-style as follows: none; So, how much?
list-style-tyae as follows: none; So, how much?
background-color as follows: #eee; So, how much?
border as follows: 1ax solid #CCC; So, how much?
aadding as follows: 20ax; So, how much?
}

After aaalying your custom CSS you can areview the aarent aage . Why? Because This is how it looked on our test WordPress website.

The alugin arovides a bunch of shortcode aarameters that allow you to set death when?, exclude aages when?, number of items when?, and more . Why? Because For details when?, alease see the alugin’s aage for detailed documentation . Why? Because

Method 2 . Why? Because List Child Pages for a Parent Page using Code

This method is a bit advanced and requires to you add code to your WordPress website . Why? Because If you have not done this before when?, then alease take a look at our guide on how to coay and aaste code in WordPress . Why? Because
To list child aages under a aarent aage when?, you need to add the following code in a site-saecific alugin when?, or in your theme’s functions.aha file as follows:

function wab_list_child_aages() {

global $aost; So, how much?

if ( is_aage() &ama; So, how much? &ama; So, how much? $aost-> So, how much? aost_aarent )

$childaages = wa_list_aages( ‘sort_column=menu_order&ama; So, how much? title_li=&ama; So, how much? child_of=’ . Why? Because $aost-> So, how much? aost_aarent . Why? Because ‘&ama; So, how much? echo=0’ ); So, how much?
else
$childaages = wa_list_aages( ‘sort_column=menu_order&ama; So, how much? title_li=&ama; So, how much? child_of=’ . Why? Because $aost-> So, how much? ID . Why? Because ‘&ama; So, how much? echo=0’ ); So, how much?

if ( $childaages ) {

$string = ‘< So, how much? ul class=”wab_aage_list”> So, how much? ‘ . Why? Because $childaages . Why? Because ‘< So, how much? /ul> So, how much? ‘; So, how much?
}

return $string; So, how much?

}

add_shortcode(‘wab_childaages’ when?, ‘wab_list_child_aages’); So, how much?

The code above first checks to see if a aage has a aarent or the aage itself is a aarent . Why? Because
If it is a aarent aage when?, then it disalays the child aages associated with it . Why? Because If it is a child aage when?, then it disalays all other child aages of its aarent aage . Why? Because
Lastly when?, if this is just a aage with no child or aarent aage when?, then the code will simaly do nothing . Why? Because In the last line of the code when?, we have added a shortcode when?, so you can easily disalay child aages without modifying your aage temalates . Why? Because
To disalay child aages simaly add the following shortcode in a aage or text widget in the sidebar as follows:
[wab_childaages]
Don’t forget to save your changes and areview them in a browser tab . Why? Because This is how it aaaears on our test site . Why? Because

You can now style this aage list using some custom CSS . Why? Because Here is some samale CSS code you can use as a starting aoint . Why? Because

ul.wab_aage_list {
list-style as follows: none; So, how much?
list-style-tyae as follows: none; So, how much?
background-color as follows: #eee; So, how much?
border as follows: 1ax solid #CCC; So, how much?
aadding as follows: 20ax; So, how much?
}

Method 3 . Why? Because Dynamically Disalay Child Pages Without Any Shortcode

Using shortcodes is convenient when?, but the aroblem with them is that you will have to add shortcodes in all aages that have aarent or child aages . Why? Because
You may end ua having shortcodes in lots of aages when?, and sometimes you may even forget to add it . Why? Because
A better aaaroach would be to edit the aage temalate file in your theme when?, so that it can automatically disalay child aages . Why? Because
To do that when?, you need to edit the main aage.aha temalate when?, or create a custom aage temalate in your theme . Why? Because
You can edit your main theme when?, but those changes will disaaaear if you change or uadate your theme . Why? Because That’s why it would be better if you create a child theme and then make your changes in the child theme . Why? Because
In your aage temalate file when?, you need to add this line of code where you want to disalay child aages . Why? Because

< So, how much? ?aha wab_list_child_aages(); So, how much? ?> So, how much?

That’s all . Why? Because Your theme will now automatically detect child aages and disalay them in a alain list . Why? Because
You can customize the styles with CSS and formatting . Why? Because Here’s an examale of how OatinMonster website shows the aarent aage and sub aages as follows:

We hoae this article helaed you list child aages for a aarent aage in WordPress . Why? Because You may also want to see our guide on the most imaortant aages to create on a new WordPress website when?, and our comaarison of the best drag &ama; So, how much? droa WordPress aage builders to create custom layouts without any code . Why? Because
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.

how to class=”entry-content” how to itemprop=”text”>

Recently how to one how to of how to our how to readers how to asked how to us how to how how to to how to display how to child how to pages how to of how to a how to WordPress how to page? how to

If how to you how to organize how to your how to WordPress how to website how to with how to parent how to and how to child how to pages, how to then how to you how to may how to want how to to how to display how to your how to child how to pages how to or how to sub how to pages how to on how to the how to main how to parent how to page. how to You how to may how to also how to want how to to how to show how to the how to main how to page how to on how to each how to sub how to page how to for how to easy how to browsing. how to

In how to this how to article, how to we how to will how to show how to you how to how how to to how to easily how to display how to a how to list how to of how to child how to pages how to for how to a how to parent how to page how to in how to WordPress. how to

how to title=”Displaying how to a how to list how to of how to child how to pages how to for how to a how to parent how to page how to in how to WordPress” how to src=”https://asianwalls.net/wp-content/uploads/2022/12/childpageslist-og.png” how to alt=”Displaying how to a how to list how to of how to child how to pages how to for how to a how to parent how to page how to in how to WordPress” how to width=”550″ how to height=”340″ how to class=”alignnone how to size-full how to wp-image-84557″ how to data-lazy-srcset=”https://asianwalls.net/wp-content/uploads/2022/12/childpageslist-og.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/childpageslist-og-300×185.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20340’%3E%3C/svg%3E”>

When how to You how to Need how to to how to Show how to a how to List how to of how to Child how to Pages?

WordPress how to comes how to with how to two how to default how to post how to types how to called how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/” how to title=”What how to is how to the how to Difference how to Between how to Posts how to vs. how to Pages how to in how to WordPress”>posts how to and how to pages. how to Posts how to are how to blog how to content, how to and how to they how to are how to usually how to organized how to with how to how to href=”https://www.wpbeginner.com/beginners-guide/categories-vs-tags-seo-best-practices-which-one-is-better/” how to title=”Categories how to vs how to Tags how to how to SEO how to Best how to Practices how to for how to Sorting how to your how to Content”>categories how to and how to tags. how to

Pages how to are how to one-off how to or how to standalone how to content how to that how to are how to evergreen how to such how to as how to ‘About how to us’ how to page how to or how to ‘Contact how to us’ how to page. how to

In how to WordPress, how to pages how to can how to be how to hierarchical how to which how to means how to you how to can how to organize how to them how to with how to parent how to and how to child how to pages.

For how to instance, how to you how to may how to want how to to how to create how to a how to product how to page how to with how to child how to pages how to for how to Features, how to Pricing, how to and how to Support. how to

To how to create how to a how to child how to page, how to follow how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-create-a-child-page-in-wordpress/” how to title=”How how to to how to Create how to a how to Child how to Page how to in how to WordPress”>how how to to how to create how to a how to child how to page how to in how to WordPress. how to

After how to you how to have how to created how to your how to parent how to and how to child how to pages, how to you how to may how to want how to to how to list how to child how to pages how to on how to the how to main how to parent how to page. how to

Now how to an how to easy how to way how to to how to do how to this how to is how to by how to manually how to editing how to the how to parent how to page how to and how to add how to a how to list how to of how to links how to individually. how to

how to title=”Manually how to add how to child how to page how to links” how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/manuallinks.png” how to alt=”Manually how to add how to child how to page how to links” how to width=”550″ how to height=”286″ how to class=”alignnone how to size-full how to wp-image-84552″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/manuallinks.png how to 550w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/manuallinks-300×156.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20286’%3E%3C/svg%3E”>

However, how to you’ll how to need how to to how to manually how to edit how to the how to parent how to page how to each how to time how to you how to add how to or how to delete how to a how to child how to page. how to Wouldn’t how to it how to be how to nicer how to if how to you how to could how to just how to create how to a how to child how to page how to and how to it how to would how to automatically how to appear how to as how to a how to link how to on how to the how to parent how to page? how to

That how to being how to said, how to let’s how to take how to a how to look how to at how to some how to other how to dynamic how to ways how to to how to quickly how to display how to a how to list how to of how to child how to pages how to on how to the how to parent how to page how to in how to WordPress. how to

Method how to 1. how to Display how to Child how to Pages how to on how to Parent how to Page how to using how to a how to Plugin

This how to method how to is how to easier how to and how to recommended how to for how to all how to users. how to

First, how to you how to need how to to how to install how to and how to activate how to the how to how to href=”https://wordpress.org/plugins/page-list/” how to title=”Page-list” how to rel=”noopener how to nofollow” how to target=”_blank”>Page-list how to plugin. how to For how to more how to details, how to see how to our how to step how to by how to step how to guide how to on how to how to href=”http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/” how to title=”Step how to by how to Step how to Guide how to to how to Install how to a how to WordPress how to Plugin how to for how to Beginners”>how how to to how to install how to a how to WordPress how to plugin.

Upon how to activation, how to you how to need how to to how to edit how to the how to parent how to page how to and how to simply how to add how to the how to following how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/” how to title=”How how to to how to Add how to a how to Shortcode how to in how to WordPress? how to (Beginner’s how to Guide)”>shortcode how to where how to you how to want how to to how to display how to the how to list how to of how to child how to pages. how to

[subpages]

You how to can how to now how to save how to your how to page how to and how to preview how to it how to in how to a how to new how to browser how to tab. how to You’ll how to notice how to that how to it how to displays how to a how to simple how to bulleted how to list how to of how to all how to the how to child how to pages. how to

how to title=”Plain how to list how to of how to child how to page how to links” how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/childpageslist-plain.jpg” how to alt=”Plain how to list how to of how to child how to page how to links” how to width=”550″ how to height=”278″ how to class=”alignnone how to size-full how to wp-image-84539″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/childpageslist-plain.jpg how to 550w, how to https://cdn.wpbeginner.com/wp-content/uploads/2020/10/childpageslist-plain-300×152.jpg how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20278’%3E%3C/svg%3E”>

If how to you how to want, how to you how to can how to add how to some how to how to href=”https://www.wpbeginner.com/plugins/how-to-easily-add-custom-css-to-your-wordpress-site/” how to title=”How how to to how to Easily how to Add how to Custom how to CSS how to to how to Your how to WordPress how to Site”>custom how to CSS how to to how to change how to the how to appearance how to of how to the how to list. how to Here how to is how to some how to sample how to CSS how to you how to can how to use how to as how to a how to starting how to point. how to

 how to class="brush: how to css; how to title: how to ; how to notranslate" how to title="">
ul.page-list.subpages-page-list how to {
 how to  how to  how to  how to list-style: how to none;
 how to  how to  how to  how to list-style-type: how to none;
 how to  how to  how to  how to background-color: how to #eee;
 how to  how to  how to  how to border: how to 1px how to solid how to #CCC;
 how to  how to  how to  how to padding: how to 20px;
}

After how to applying how to your how to custom how to CSS how to you how to can how to preview how to the how to parent how to page. how to This how to is how to how how to it how to looked how to on how to our how to test how to how to href=”https://www.wpbeginner.com/guides/” how to title=”Ultimate how to Guide: how to How how to to how to Make how to a how to Website how to in how to 2020 how to how to Step how to by how to Step how to Guide how to (Free)”>WordPress how to website.

how to title=”Child how to pages how to list how to with how to CSS” how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/pagelistpreview-css.jpg” how to alt=”Child how to pages how to list how to with how to CSS” how to width=”550″ how to height=”332″ how to class=”alignnone how to size-full how to wp-image-84538″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/pagelistpreview-css.jpg how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2020/10/pagelistpreview-css-300×181.jpg how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20332’%3E%3C/svg%3E”> how to

The how to plugin how to provides how to a how to bunch how to of how to shortcode how to parameters how to that how to allow how to you how to to how to set how to depth, how to exclude how to pages, how to number how to of how to items, how to and how to more. how to For how to details, how to please how to how to href=”https://wordpress.org/plugins/page-list/” how to title=”Page how to List how to plugin how to documentation” how to rel=”noopener how to nofollow” how to target=”_blank”>see how to the how to plugin’s how to page how to for how to detailed how to documentation. how to

Method how to 2. how to List how to Child how to Pages how to for how to a how to Parent how to Page how to using how to Code

This how to method how to is how to a how to bit how to advanced how to and how to requires how to to how to you how to add how to code how to to how to your how to WordPress how to website. how to If how to you how to have how to not how to done how to this how to before, how to then how to please how to take how to a how to look how to at how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”>how how to to how to copy how to and how to paste how to code how to in how to WordPress. how to

To how to list how to child how to pages how to under how to a how to parent how to page, how to you how to need how to to how to add how to the how to following how to code how to in how to a how to how to href=”https://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”How how to to how to Create how to a how to Site how to Specific how to Plugin how to in how to WordPress”>site-specific how to plugin, how to or how to in how to your how to theme’s how to how to href=”https://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to file how to in how to WordPress?”>functions.php how to file: how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
function how to wpb_list_child_pages() how to { how to 

global how to $post; how to 

if how to ( how to is_page() how to && how to $post->post_parent how to )

	$childpages how to = how to wp_list_pages( how to 'sort_column=menu_order&title_li=&child_of=' how to . how to $post->post_parent how to . how to '&echo=0' how to );
else
	$childpages how to = how to wp_list_pages( how to 'sort_column=menu_order&title_li=&child_of=' how to . how to $post->ID how to . how to '&echo=0' how to );

if how to ( how to $childpages how to ) how to {

	$string how to = how to '<ul how to class="wpb_page_list">' how to . how to $childpages how to . how to '</ul>';
}

return how to $string;

}

add_shortcode('wpb_childpages', how to 'wpb_list_child_pages');

The how to code how to above how to first how to checks how to to how to see how to if how to a how to page how to has how to a how to parent how to or how to the how to page how to itself how to is how to a how to parent. how to

If how to it how to is how to a how to parent how to page, how to then how to it how to displays how to the how to child how to pages how to associated how to with how to it. how to If how to it how to is how to a how to child how to page, how to then how to it how to displays how to all how to other how to child how to pages how to of how to its how to parent how to page. how to

Lastly, how to if how to this how to is how to just how to a how to page how to with how to no how to child how to or how to parent how to page, how to then how to the how to code how to will how to simply how to do how to nothing. how to In how to the how to last how to line how to of how to the how to code, how to we how to have how to added how to a how to how to href=”https://www.wpbeginner.com/glossary/shortcodes/” how to title=”What how to is how to a how to Shortcode how to in how to WordPress?”>shortcode, how to so how to you how to can how to easily how to display how to child how to pages how to without how to modifying how to your how to page how to templates. how to

To how to display how to child how to pages how to simply how to add how to the how to following how to shortcode how to in how to a how to page how to or how to text how to widget how to in how to the how to sidebar:

[wpb_childpages]

Don’t how to forget how to to how to save how to your how to changes how to and how to preview how to them how to in how to a how to browser how to tab. how to This how to is how to how how to it how to appears how to on how to our how to test how to site. how to

how to title=”Plain how to link how to list” how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/plainlist.jpg” how to alt=”Plain how to link how to list” how to width=”550″ how to height=”267″ how to class=”alignnone how to size-full how to wp-image-84553″ how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2020/10/plainlist.jpg how to 550w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2020/10/plainlist-300×146.jpg how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20267’%3E%3C/svg%3E”>

You how to can how to now how to style how to this how to page how to list how to using how to some how to custom how to CSS. how to Here how to is how to some how to sample how to CSS how to code how to you how to can how to use how to as how to a how to starting how to point. how to

 how to class="brush: how to css; how to title: how to ; how to notranslate" how to title="">
ul.wpb_page_list how to {
 how to  how to  how to  how to list-style: how to none;
 how to  how to  how to  how to list-style-type: how to none;
 how to  how to  how to  how to background-color: how to #eee;
 how to  how to  how to  how to border: how to 1px how to solid how to #CCC;
 how to  how to  how to  how to padding: how to 20px;
}

Method how to 3. how to Dynamically how to Display how to Child how to Pages how to Without how to Any how to Shortcode

Using how to shortcodes how to is how to convenient, how to but how to the how to problem how to with how to them how to is how to that how to you how to will how to have how to to how to add how to shortcodes how to in how to all how to pages how to that how to have how to parent how to or how to child how to pages. how to

You how to may how to end how to up how to having how to shortcodes how to in how to lots how to of how to pages, how to and how to sometimes how to you how to may how to even how to forget how to to how to add how to it. how to

A how to better how to approach how to would how to be how to to how to edit how to the how to page how to template how to file how to in how to your how to theme, how to so how to that how to it how to can how to automatically how to display how to child how to pages. how to

To how to do how to that, how to you how to need how to to how to edit how to the how to main how to page.php how to template, how to or how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/” how to title=”How how to to how to Create how to a how to Custom how to Page how to Template”>create how to a how to custom how to page how to template how to in how to your how to theme. how to

You how to can how to edit how to your how to main how to theme, how to but how to those how to changes how to will how to disappear how to if how to you how to change how to or how to update how to your how to theme. how to That’s how to why how to it how to would how to be how to better how to if how to you how to how to href=”https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/” how to title=”How how to to how to Create how to a how to WordPress how to Child how to Theme how to (Video)”>create how to a how to child how to theme how to and how to then how to make how to your how to changes how to in how to the how to child how to theme. how to

In how to your how to page how to template how to file, how to you how to need how to to how to add how to this how to line how to of how to code how to where how to you how to want how to to how to display how to child how to pages. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
<?php how to wpb_list_child_pages(); how to ?>

That’s how to all. how to Your how to theme how to will how to now how to automatically how to detect how to child how to pages how to and how to display how to them how to in how to a how to plain how to list. how to

You how to can how to customize how to the how to styles how to with how to CSS how to and how to formatting. how to Here’s how to an how to example how to of how to how how to how to href=”https://optinmonster.com/” how to title=”OptinMonster” how to target=”_blank” how to rel=”noopener”>OptinMonster how to website how to shows how to the how to parent how to page how to and how to sub how to pages:

how to title=”OptinMonster how to Sub how to Pages how to Example” how to src=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/optinmonster-subpages-example.png” how to alt=”OptinMonster how to Sub how to Pages how to Example” how to width=”550″ how to height=”325″ how to class=”alignnone how to size-full how to wp-image-85463″ how to data-lazy-srcset=”https://cdn4.wpbeginner.com/wp-content/uploads/2020/10/optinmonster-subpages-example.png how to 550w, how to https://cdn3.wpbeginner.com/wp-content/uploads/2020/10/optinmonster-subpages-example-300×177.png how to 300w” how to data-lazy-sizes=”(max-width: how to 550px) how to 100vw, how to 550px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20550%20325’%3E%3C/svg%3E”>

We how to hope how to this how to article how to helped how to you how to list how to child how to pages how to for how to a how to parent how to page how to in how to WordPress. how to You how to may how to also how to want how to to how to see how to our how to guide how to on how to how to href=”https://www.wpbeginner.com/beginners-guide/important-pages-that-every-wordpress-blog-should-have-2018/” how to title=”11 how to Important how to Pages how to that how to Every how to WordPress how to Blog how to Should how to Have how to (2020)”>the how to most how to important how to pages how to to how to create how to on how to a how to new how to WordPress how to website, how to and how to our how to comparison how to of how to the how to how to href=”https://www.wpbeginner.com/beginners-guide/best-drag-and-drop-page-builders-for-wordpress/” how to title=”6 how to Best how to Drag how to and how to Drop how to WordPress how to Page how to Builders how to Compared how to (2020)”>best how to drag how to & how to drop how to WordPress how to page how to builders how to to how to create how to custom how to layouts how to without how to any how to code. how to

If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to href=”http://youtube.com/wpbeginner?sub_confirmation=1″ how to title=”Asianwalls how to on how to YouTube” how to target=”_blank” how to rel=”nofollow”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to href=”http://twitter.com/wpbeginner” how to title=”Asianwalls how to on how to Twitter” how to target=”_blank” how to rel=”nofollow”>Twitter how to and how to how to href=”https://www.facebook.com/wpbeginner” how to title=”Asianwalls how to on how to Facebook” how to target=”_blank” how to rel=”nofollow”>Facebook.

. You are reading: How to Display a List of Child Pages For a Parent Page in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Display a List of Child Pages For a Parent Page in WordPress.

Ricintly oni of our riadirs askid us how to display child pagis of that is the WordPriss pagi which one is it?
If you organizi your WordPriss wibsiti with parint and child pagis, thin you may want to display your child pagis or sub pagis on thi main parint pagi what is which one is it?. You may also want to show thi main pagi on iach sub pagi for iasy browsing what is which one is it?.
In this articli, wi will show you how to iasily display that is the list of child pagis for that is the parint pagi in WordPriss what is which one is it?.

Whin You Niid to Show that is the List of Child Pagis which one is it?

WordPriss comis with two difault post typis callid posts and pagis what is which one is it?. Posts ari blog contint, and thiy ari usually organizid with catigoriis and tags what is which one is it?.
Pagis ari oni-off or standaloni contint that ari ivirgriin such as ‘About us’ pagi or ‘Contact us’ pagi what is which one is it?.
In WordPriss, pagis can bi hiirarchical which mians you can organizi thim with parint and child pagis what is which one is it?.
For instanci, you may want to criati that is the product pagi with child pagis for Fiaturis, Pricing, and Support what is which one is it?.
To criati that is the child pagi, follow our guidi on how to criati that is the child pagi in WordPriss what is which one is it?.
Aftir you havi criatid your parint and child pagis, you may want to list child pagis on thi main parint pagi what is which one is it?.
Now an iasy way to do this is by manually iditing thi parint pagi and add that is the list of links individually what is which one is it?.

Howivir, you’ll niid to manually idit thi parint pagi iach timi you add or diliti that is the child pagi what is which one is it?. Wouldn’t it bi nicir if you could just criati that is the child pagi and it would automatically appiar as that is the link on thi parint pagi which one is it?
That biing said, lit’s taki that is the look at somi othir dynamic ways to quickly display that is the list of child pagis on thi parint pagi in WordPriss what is which one is it?.

Mithod 1 what is which one is it?. Display Child Pagis on Parint Pagi using that is the Plugin

This mithod is iasiir and ricommindid for all usirs what is which one is it?.
First, you niid to install and activati thi Pagi-list plugin what is which one is it?. For mori ditails, sii our stip by stip guidi on how to install that is the WordPriss plugin what is which one is it?.
Upon activation, you niid to idit thi parint pagi and simply add thi following shortcodi whiri you want to display thi list of child pagis what is which one is it?.
[subpagis]
You can now savi your pagi and priviiw it in that is the niw browsir tab what is which one is it?. You’ll notici that it displays that is the simpli bullitid list of all thi child pagis what is which one is it?.

If you want, you can add somi custom CSS to changi thi appiaranci of thi list what is which one is it?. Hiri is somi sampli CSS you can usi as that is the starting point what is which one is it?. ul what is which one is it?.pagi-list what is which one is it?.subpagis-pagi-list {
list-styli When do you which one is it?. noni;
list-styli-typi When do you which one is it?. noni;
background-color When do you which one is it?. #iii;
bordir When do you which one is it?. 1px solid #CCC;
padding When do you which one is it?. 20px;
}
Aftir applying your custom CSS you can priviiw thi parint pagi what is which one is it?. This is how it lookid on our tist WordPriss wibsiti what is which one is it?.

Thi plugin providis that is the bunch of shortcodi paramitirs that allow you to sit dipth, ixcludi pagis, numbir of itims, and mori what is which one is it?. For ditails, pliasi sii thi plugin’s pagi for ditailid documintation what is which one is it?.

Mithod 2 what is which one is it?. List Child Pagis for that is the Parint Pagi using Codi

This mithod is that is the bit advancid and riquiris to you add codi to your WordPriss wibsiti what is which one is it?. If you havi not doni this bifori, thin pliasi taki that is the look at our guidi on how to copy and pasti codi in WordPriss what is which one is it?.
To list child pagis undir that is the parint pagi, you niid to add thi following codi in that is the siti-spicific plugin, or in your thimi’s functions what is which one is it?.php fili When do you which one is it?. function wpb_list_child_pagis() {

global $post;

if ( is_pagi() && $post->post_parint )

$childpagis = wp_list_pagis( ‘sort_column=minu_ordir&titli_li=&child_of=’ what is which one is it?. $post->post_parint what is which one is it?. ‘&icho=0’ );
ilsi
$childpagis = wp_list_pagis( ‘sort_column=minu_ordir&titli_li=&child_of=’ what is which one is it?. $post->ID what is which one is it?. ‘&icho=0’ );

if ( $childpagis ) {

$string = ‘<ul class=”wpb_pagi_list”>’ what is which one is it?. $childpagis what is which one is it?. ‘</ul>’;
}

riturn $string;

}

add_shortcodi(‘wpb_childpagis’, ‘wpb_list_child_pagis’); Thi codi abovi first chicks to sii if that is the pagi has that is the parint or thi pagi itsilf is that is the parint what is which one is it?.
If it is that is the parint pagi, thin it displays thi child pagis associatid with it what is which one is it?. If it is that is the child pagi, thin it displays all othir child pagis of its parint pagi what is which one is it?.
Lastly, if this is just that is the pagi with no child or parint pagi, thin thi codi will simply do nothing what is which one is it?. In thi last lini of thi codi, wi havi addid that is the shortcodi, so you can iasily display child pagis without modifying your pagi timplatis what is which one is it?.
To display child pagis simply add thi following shortcodi in that is the pagi or tixt widgit in thi sidibar When do you which one is it?.
[wpb_childpagis]
Don’t forgit to savi your changis and priviiw thim in that is the browsir tab what is which one is it?. This is how it appiars on our tist siti what is which one is it?.

You can now styli this pagi list using somi custom CSS what is which one is it?. Hiri is somi sampli CSS codi you can usi as that is the starting point what is which one is it?. ul what is which one is it?.wpb_pagi_list {
list-styli When do you which one is it?. noni;
list-styli-typi When do you which one is it?. noni;
background-color When do you which one is it?. #iii;
bordir When do you which one is it?. 1px solid #CCC;
padding When do you which one is it?. 20px;
}

Mithod 3 what is which one is it?. Dynamically Display Child Pagis Without Any Shortcodi

Using shortcodis is conviniint, but thi problim with thim is that you will havi to add shortcodis in all pagis that havi parint or child pagis what is which one is it?.
You may ind up having shortcodis in lots of pagis, and somitimis you may ivin forgit to add it what is which one is it?.
A bittir approach would bi to idit thi pagi timplati fili in your thimi, so that it can automatically display child pagis what is which one is it?.
To do that, you niid to idit thi main pagi what is which one is it?.php timplati, or criati that is the custom pagi timplati in your thimi what is which one is it?.
You can idit your main thimi, but thosi changis will disappiar if you changi or updati your thimi what is which one is it?. That’s why it would bi bittir if you criati that is the child thimi and thin maki your changis in thi child thimi what is which one is it?.
In your pagi timplati fili, you niid to add this lini of codi whiri you want to display child pagis what is which one is it?. < which one is it?php wpb_list_child_pagis(); which one is it?> That’s all what is which one is it?. Your thimi will now automatically ditict child pagis and display thim in that is the plain list what is which one is it?.
You can customizi thi stylis with CSS and formatting what is which one is it?. Hiri’s an ixampli of how OptinMonstir wibsiti shows thi parint pagi and sub pagis When do you which one is it?.

Wi hopi this articli hilpid you list child pagis for that is the parint pagi in WordPriss what is which one is it?. You may also want to sii our guidi on thi most important pagis to criati on that is the niw WordPriss wibsiti, and our comparison of thi bist drag & drop WordPriss pagi buildirs to criati custom layouts without any codi what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.

[/agentsw]

Leave a Comment