What is a parent page in wordpress

New Page

Pages » Page Attributes

The Page Attributes module in Page Settings allows you to set parent pages and change the order of your pages.

Table of contents

  1. Access to page attributes
  2. Main page
  3. Page order

Access to page attributes

  1. Go to My Site → Pages.
  2. Elija a specific page for the editor.
  3. On the right of your screen, under Page Settings, look for Page Attributes .

If you cannot find the page configuration, click on the configuration icon junto a publicar para expandir el menú de la barra lateral.

WordPress Editor - SetupSidebar configuration

Screenshot with page attribute settings in the sidebarThe page attributes option in “Page Setup” for a page.

↑ Index ↑

Main page

El uso de páginas principales es una buena manera de organizar las páginas de su sitio en jerarquías. Una página principal es una página de nivel superior, con páginas secundarias anidadas debajo.

Home page selection option in sidebar Parent page drop down in Page Settings

For example, you could have an “About” page as a top level or parent page, and then have child pages “Life Story” and “My Dogs” under it. Under “My Dogs” you could have another page, titled “Rosco”. The URLs might look like this:

  • http://example.wordpress.com/about/
  • http://example.wordpress.com/about/life-story/
  • http://example.wordpress.com/about/my-dogs/
  • http://example.wordpress.com/about/my-dogs/rosco/

Configuration of the page - Main pages Parent page selection

Some page slugs, such as “author,” “tag,” and “category” are reserved for special uses. You can’t create a child page if the parent page uses one of those reserved slugs.

If you are using your site’s default menu, parent pages will usually show in the menu with child pages as a drop down. If you are using a custom menu, you can add dropdown menus by clicking on Reorder in the Customizer.

With the Ixion theme activated, it would look like this:

Page Setup - Menu Parent and Child Pages

There are no limits to how deeply you can nest pages.

Not all themes display Page hierarchies by default in the navigation menu. If this is the case with the theme you are using, then you can use the Custom Menus feature to create sub-pages and to customize your navigation menus.

↑ Índice ↑

Page Order

You can change the order that your pages are displayed when using a default menu by using the Order field of the Page Attributes module.

Let’s say you have three pages: About, Photos, Contact

If you wanted About to appear first, you’d need to do the following:

  1. Go to My Site(s) → Pages in your dashboard
  2. Find the page About and click the title.
  3. Locate the Page Attributes module to the right of the editor.
  4. Put the number 1 in the box for Order. This tells WordPress to display this page first on your site.
  5. Click the Update button.

Repeat the process for your other pages, but use higher numbers for the Order field: 2, 3, etc. This tells WordPress to display these pages second and third on your blog.

If you are using a custom menu, you can change the order of your pages in the menu using the Reorder link in the Customizer.

If you are using the Pages widget, be sure to set the Sort By option to Page Order after setting a custom order for your pages. Then click Publish .

Pants Capture 2016-03-14 at 10.35.08 am

Versatile planes and prices

  • libre

    plan-free-circle

    the best for the students

  • Personnel

    plan-personal-circle

    The best for fans

  • Top quality

    plan-premium-circle

    The best for freelancers

  • Business

    plan-business-circle

    The best for small businesses

choose a plan

Am I still confused?

Contact support.

Help us improve:

Nous cherchons toujours à améliorer notre documentation. Si cette page n’a pas répondu à votre question ou vous a donné envie d’en savoir plus, faites-le nous savoir ! Nous aimons entendre vos commentaires. Pour obtenir de l’aide, veuillez utiliser les forums ou contacter le formulaire d’assistance. Merci!

Nombre

Email

Sitio web

Δ

WordPress Basics

05 de julio de 2022

Jordana A.

5 minutos de lectura

Parent Page WordPress: Understanding Its Purpose and How to Set It Up

Copiar link

¡Copiado!

WordPress has two default post types – posts and pages. However, unlike posts and other custom post types, pages don’t have to be on the same level. Users can create parent and child pages, establishing a page hierarchy on their sites.

Download Ultimate WordPress Cheat Sheet

The practice is particularly beneficial for WordPress websites with a lot of static information as it’ll help visitors easily navigate them.

This article will cover the steps to create a parent page in WordPress and display a list of child pages using three different methods. You will also learn how to manage the parent-child relationship between pages.

  • ¿Qué es una página principal?
  • Diferencias entre una página principal y una página secundaria
  • Cómo configurar páginas principales y secundarias en WordPress
  • Cómo mostrar la lista de páginas secundarias de una página principal
    • Use un complemento para mostrar la lista de páginas secundarias
    • Mostrar la lista de páginas secundarias por codificación
    • Edit the Page Template to Show the List of Child Pages
    • Bonus: How to Manage Parent and Child Pages

What Is a Parent Page?

A WordPress parent page is a top-level page in the site’s hierarchy. The group of sub-pages nestled under it are called child pages.

Differences Between a Parent Page and a Child Page

Creating a hierarchical structure requires establishing a parent-child relationship between individual pages. In this arrangement, parent pages are superior to child pages, meaning child pages cannot exist without them.

Hostinger Tutorials Homepage - Follow one of our tutorials Hostinger Tutorials parent page - Follow along with one of our tutorials

Take Hostinger Tutorials as an example. Under the main menu, you’ll find eight categories, including WordPress, VPS, and Video Tutorials. These are all child pages under the parent page /tutorials/.

Another factor that differentiates child pages from parent pages is the URL. By default, child pages carry their parent page’s slug in their URL.

For instance, the URL of the Hostinger Tutorials parent page is /tutorials/, while the WordPress child page is /tutorials/wordpress.

How to Set Parent and Child Pages in WordPress

To establish a hierarchical page structure, you’ll need to publish your first page in WordPress. Here are the steps to create parent pages:

  1. On your WordPress dashboard, navigate to Pages -> Add New.
  2. Write the page’s title and content.
  3. Click Preview to see what it will look like and hit Publish once you’re finished.

The draft of a main page in the WordPress editor A parent page's draft on the WordPress editor

Repeat these steps to add other parent pages to your website.

Now, you can start creating child pages:

  1. On your WordPress dashboard, go to Pages -> Add New.
  2. Enter the desired title and content.
  3. Open the Page tab and scroll down to Page Attributes. Choose a specific page to set as the parent from the drop-down menu.

The Page Attributes section in the WordPress editor The Page Attributes section on the WordPress editor

  1. Click Publish.

Repeat these steps as necessary to create multiple child pages. You can change their order of appearance by assigning a numeric value. To do that, use the Order textbox in the Page Attributes section.

Page Attributes Not Showing Up?

Click the Screen Options drop-down menu at the top of the page and check the box next to the Page Attributes option. Now, you’ll be able to set parent pages.

How to Display the List of Child Pages of a Parent Page

Displaying the list of child pages on their respective parent page is a great way to have a clear structure. It allows visitors to find the information they’re looking for much faster and easier, improving the user experience and the site’s navigation.

There are three ways to display a list of your child pages ‒ using a WordPress plugin, coding it manually, or editing the page template.

Use a Plugin to Show the List of Child Pages

This method is the easiest because it streamlines the configuration process. The best WordPress plugins provide shortcode parameters to add the list of child pages to a parent page and set the list style.

There are plenty of plugins available in the WordPress directory. In this tutorial, we’ll be using Page-list. First, install and activate the plugin.

The Add Plugins section that features the page list plugin in search results The Add Plugins section featuring the Page-list plugin on the search results

On the plugin’s page, you’ll see a collection of shortcodes with parameters for list styling:

  • [pagelist] ‒ showcase the sitemap of the site.
  • [subpages] ‒ display the current page’s child pages.
  • [siblings] ‒ display the current page’s sibling pages, which are pages grouped under the same parent page.
  • [pagelist_ext] ‒ showcase the list of pages with their respective featured images and excerpts.

Here’s how to use the Page-list plugin to display a list of child pages in WordPress:

  1. Insert the [subpages] shortcode anywhere within the desired parent page and hit Update.

A main page with the subpages shortcode and the Refresh button highlighted A parent page with the subpages shortcode and the Update button highlighted

  1. The following image features an example of the shortcode’s application. You can add a custom CSS class or combine the main shortcode with the available parameters to style the list.

An example of how a list of child pages appears in WordPress An example of how a list of child pages appears in WordPress

Show the List of Child Pages by Coding

Manually coding offers more flexibility in customizing the list of child pages. However, the process requires some technical knowledge, which may not suit WordPress beginners and non-technical users.

The code needs to be added to your theme’s functions.php file, accessible through an FTP client or a File Manager.

If you use our site hosting services, here are the steps to create a child page index using Hostinger File Manager:

  1. On hPanel, navigate to Files -> File Manager.
  2. From your root directory (public_html), access wp-content -> themes.
  3. Open the folder of the theme that’s currently active and locate the functions.php file.
  4. Double-click it and add the following code at the bottom of the file:

fonction wpb_list_child_pages() {   mondial $post;   if ( is_page() && $post->post_parent )     $childpages = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->post_parent . ‘ &echo=0’ ); sinon     $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>’ ; }  renvoie $string;  } add_shortcode(‘wpb_childpages’, ‘wpb_list_child_pages’);

  1. Save changes. Now go to your WordPress dashboard.
  2. Vaya has Apariencia -> Widgets and groups the shortcode [ wpb_childpages ] into algún lugar del área de widgets. Alternatively, insert directly into the main pages.

A WordPress page with a list of secondary pages aggregated by codification A WordPress page with a list of child pages added by coding

Important ! The [wpb_childpages] shortcode does not work on pages that any part of the jerárquica estructura.

Edit the page template to display the list of secondary pages

Using shortcodes makes sense if you have a small number of pages. For a large-scale website, it’s best to edit the page template file and automate the embedding process.

Para hacerlo, agregue el código mencionado anteriormente al archivo functions.php . Read, insert this code fragment in the page.php archive of your active theme  :

<?php wpb_list_child_pages(); ?>

That c’est tout! The theme will automatically detect child pages and display them on the website.

Bonus: How to manage the main and secondary pages

As mentioned above, having a hierarchical structure can significantly improve the navigation and user experience of your WordPress site. What many WordPress users don’t know is that the structure of the page can also influence the reference of your site.

Done correctly, page structure helps search engines like Google crawl and index a site by making its content easier to find and understand. Additionally, the hierarchy tells search engines which pages are important, which increases a site’s authority and searchability.

Here are some tips to help you get the most out of your page structure:

  • Group only relevant content  : take into account the correlation between the keywords of a main page and its secondary pages.
  • Decide the order  – In most cases, child pages are displayed based on keyword popularity to shorten the search time for visitors. Sans however, there are cases where it is better to organize them according to the priority of the content.
  • Don’t create too many categories – keep them between two and seven to avoid overwhelming users with subpages.
  • Keep your sitemap up to date  – Update your WordPress sitemap every time you create a new page or change the content of existing ones to speed up the indexing process.

Conclusion

Setting up WordPress home pages isn’t an essential task, but we highly recommend it. Create a hierarchical structure that will make your WordPress website easy to navigate.

We hope this article has helped you understand the purpose of parent and child pages in WordPress and how to set them up correctly. Good luck !

Was this tutorial helpful?

And

Non

Auteur Auteur

The author

Jordana A.

Jordana is a digital content writer at Hostinger. With her knowledge of information systems and website development, she aims to help aspiring developers and entrepreneurs develop their technical skills. In her free time, she travels and enjoys free writing.

More from Jordana A.

Google Google translator

Google Google Translate


Video What is a parent page in wordpress

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…