WordPress has a built-in subpage characteristic permitting you to arrange pages in a parent-child-sibling tree, and place them on the menu.
That begs a pair questions… Why would I exploit subpages? What plugins can be found to help and improve them?
That’s precisely what we’ll be addressing on this article.
Proceed studying, or bounce forward utilizing these hyperlinks:
Why Use Subpages?
Creating Subpages and Including to the Most important Menu
Utilizing a Widget to Place a Subpage Menu in a Sidebar
Utilizing a Plugin for Improved Navigation on Every Subpage
Wrapping Up
Why Use Subpages?
The most effective use of subpages is to arrange hierarchical content material right into a hierarchy or define.
The subpage characteristic shouldn’t be used to paginate an extended web page. If you happen to didn’t already know, James thinks Pagination Is Evil, and that’s not what I’m speaking about.
If you happen to merely have an extended web page, use the nextpage tag, which paginates an extended web page or put up.
We will already do that just by utilizing the HTML heading tags (h1, h2, h3, and so forth.) as is finished in most objects posted right here at WPMUDEV.com, and on this put up. However subpages add the extra talents to put them on the menu, in a sidebar menu, and supply navigation between them.
Creating Subpages and Including to the Most important Menu
Earlier than we are able to use any of the superior subpage options, let’s see the best way to create subpages.
When including or enhancing a web page, in the suitable hand-column below the heading Web page Attributes, choose Mum or dad for the web page, making the web page we’re engaged on a subpage or “youngster” of “CV”.
The opposite “Exhibition” pages listed below are dad or mum (“CV”) are additionally subpages, and are the “siblings” of the “Celine Raphel-Leygues” web page.
As soon as a subpage has been created, it may be added to the menu by hand. Or higher but, through the use of a plugin to Robotically Add WordPress Submenu to Mum or dad Menu for Pages, giving this end result:
Subpages in the primary menu dropdown.
Utilizing a Widget to Place a Subpage Menu in a Sidebar
Within the following instance, I first used the Subpages Prolonged plugin to create a subpage menu within the sidebar.
Subpages Prolonged plugin within the Web page editor.
Then I used the Customized Sidebars plugin to show this menu on the dad or mum web page and its subpages solely.
Subpage menu in sidebar created with the Subpages Prolonged and Customized Sidebars plugins.
The Subpages Prolonged plugin creates a subpages navigation (desk of contents) in your pages and your sidebar.
The widget choice is really easy to make use of, and the shortcode choice offers you extra management for manipulating your subpages menus.
Right here is the fundamental shortcode utilization:
[subpages exceptme=”true” childof=”253″]The Customized Sidebars plugin is a versatile widget space supervisor that permits you to exchange sidebars—and different widget areas—in your web site. (Customized Sidebars works with the traditional widgets display that was utilized in WordPress earlier than model 5.8. To make use of it with model 5.8 and above, you’ll want to put in the official Traditional Widgets plugin).
Utilizing a Plugin for Improved Navigation on Every Subpage
When utilizing the nextpage WordPress tag, the navigation inserted on the backside of every paginated web page merely lists the paginated pages as numbers (i.e., 1, 2, 3, 4) with every web page quantity linked appropriately.
This works nice for breaking apart an extended web page, however not once we wish to arrange the data into subpages to realize the advantages of the subpage characteristic and plugins. (See Pagination: Methods to Cut up a WordPress Publish into A number of Pages tutorial.)
I used the Checklist Pages Shortcodes plugin to put navigation on the prime of every subpage and the dad or mum web page.
Right here’s what it seems like on one of many subpages:
Subpage navigation on subpage utilizing the Checklist Pages Shortcodes plugin.
That is the shortcode I used:
[sibling-pages exclude=”150″]I selected to exclude a hyperlink to the subpage at present being displayed from these hyperlinks. On this instance “Exhibitions 2020–2022” is pageid 150, and is excluded within the shortcode.
One different plugin I made use of was Catch Ids—making it simpler to find out the pageid’s for my dad or mum web page and subpages.
Although a few of these plugins are a yr or extra out from updates, we examined them (through the 2022 rewrite of this put up), they usually nonetheless labored as anticipated.
Wrapping Up
So there you might have it. A neat and tidy solution to implement subpages and widgets, utilizing a number of helpful plugins, and a little bit of shortcode.
Editor’s Notice: This put up has been up to date for accuracy and relevancy.
[Originally Published: September 2013 / Revised: April 2022]
Subscribe to MarketingSolution.
Receive web development discounts & web design tutorials.
Now! Lets GROW Together!