{"id":83262,"date":"2012-06-26T14:30:55","date_gmt":"2012-06-26T18:30:55","guid":{"rendered":"http:\/\/wpmu.org\/?p=83262"},"modified":"2022-04-19T03:35:13","modified_gmt":"2022-04-19T03:35:13","slug":"what-are-subpages-and-why-would-i-use-them","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/what-are-subpages-and-why-would-i-use-them\/","title":{"rendered":"What Are Subpages and Why Would I Use Them?"},"content":{"rendered":"<p>WordPress has a built-in subpage feature allowing you to organize pages in a parent-child-sibling tree, and place them on the menu.<\/p>\n<p>That begs a couple questions\u2026 Why would I use subpages? What plugins are available to assist and enhance them?<\/p>\n<p>That\u2019s exactly what we\u2019ll be addressing in this article.<\/p>\n<p>Continue reading, or jump ahead using these links:<\/p>\n<ul>\n<li><a href=\"#why\">Why Use Subpages?<\/a><\/li>\n<li><a href=\"#creating\">Creating Subpages and Adding to the Main Menu<\/a><\/li>\n<li><a href=\"#widget\">Using a Widget to Place a Subpage Menu in a Sidebar<\/a><\/li>\n<li><a href=\"#plugin\">Using a Plugin for Improved Navigation on Each Subpage<\/a><\/li>\n<li><a href=\"#summary\">Wrapping Up<\/a><\/li>\n<\/ul>\n<h2><a id=\"why\" target=\"_blank\"><\/a>Why Use Subpages?<\/h2>\n<p>The best use of subpages is to organize hierarchical content into a hierarchy or outline.<\/p>\n<p>The subpage feature should not be used to paginate a long page.\u00a0If you didn&#8217;t already know, James thinks <a href=\"https:\/\/wpmudev.com\/blog\/pagination-is-evil-and-you-shouldnt-do-it\/\" target=\"_blank\" rel=\"noopener\">Pagination Is Evil<\/a>, and that\u2019s <em>not<\/em> what I\u2019m talking about.<\/p>\n<p>If you simply have a long page, use the <a href=\"https:\/\/wpmudev.com\/blog\/pagination-how-to-split-a-wordpress-post-into-multiple-pages\/\" target=\"_blank\" rel=\"noopener\">nextpage tag<\/a>, which paginates a long page or post.<\/p>\n<p>We can already do this simply by using the HTML heading tags (h1, h2, h3, etc.) as is done in most items posted here at WPMUDEV.com, and in this post. But subpages add the additional abilities to place them on the menu, in a sidebar menu, and provide navigation between them.<\/p>\n<h2><a id=\"creating\" target=\"_blank\"><\/a>Creating Subpages and Adding to the Main Menu<\/h2>\n<p>Before we can use any of the advanced subpage features, let\u2019s see how to create subpages.<\/p>\n<p>When adding or editing a page, in the right hand-column under the heading <strong>Page Attributes<\/strong>, select <em>Parent <\/em>for the page, making the page we\u2019re working on a subpage or \u201cchild\u201d of \u201cCV\u201d.<\/p>\n<p>The other \u201cExhibition\u201d pages listed under are parent (\u201cCV\u201d) are also subpages, and are the \u201csiblings\u201d of the \u201cCeline Raphel-Leygues\u201d page.<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-ratio-full wp-image-209165\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/page-attributes-parent-child-siblings-1050x528.png\" alt=\"Page attributes\" width=\"1050\" height=\"528\" \/><\/div>\n<\/div>\n<p>Once a subpage has been created, it can be added to the menu by hand. Or better yet, by using a plugin to <a href=\"https:\/\/wpmudev.com\/blog\/automatically-add-wordpress-submenu-to-parent-menu-for-pages\/\" target=\"_blank\" rel=\"noopener\">Automatically Add WordPress Submenu to Parent Menu for Pages<\/a>, giving this result:<\/p>\n<figure id=\"attachment_209167\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-full wp-image-209167\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/header-parent-child-sibling-page-menus-1050x459.png\" alt=\"Main dropdown menu, parent-child-siblings.\" width=\"1050\" height=\"459\" \/><figcaption class=\"wp-caption-text\">Subpages in the main menu dropdown.<\/figcaption><\/figure>\n<h2><a id=\"widget\" target=\"_blank\"><\/a>Using a Widget to Place a Subpage Menu in a Sidebar<\/h2>\n<p>In the following example, I first used the <a href=\"https:\/\/wordpress.org\/plugins\/subpages-extended\/\" rel=\"noopener\" target=\"_blank\">Subpages Extended<\/a> plugin to create a subpage menu in the sidebar.<\/p>\n<figure id=\"attachment_209168\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-full wp-image-209168\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/subpages-extended-screenshot-1050x773.png\" alt=\"Subpages Extended plugin in the Page editor.\" width=\"1050\" height=\"773\" \/><figcaption class=\"wp-caption-text\"><em>Subpages Extended<\/em> plugin in the Page editor.<\/figcaption><\/figure>\n<p>Then I used the <a href=\"https:\/\/wordpress.org\/plugins\/custom-sidebars\/\" rel=\"noopener\" target=\"_blank\">Custom Sidebars<\/a> plugin to display this menu on the parent page and its subpages only.<\/p>\n<figure id=\"attachment_209169\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-full wp-image-209169\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/subpages-menu-in-sidebar-1050x583.png\" alt=\"Subpage menu in sidebar created with the Subpages Extended and Custom Sidebars plugins.\" width=\"1050\" height=\"583\" \/><figcaption class=\"wp-caption-text\">Subpage menu in sidebar created with the Subpages Extended and Custom Sidebars plugins.<\/figcaption><\/figure>\n<p>The <em>Subpages Extended<\/em> plugin creates a subpages navigation (table of contents) on your pages and your sidebar.<\/p>\n<p>The widget option is so easy to use, and the shortcode option gives you more control for manipulating your subpages menus.<\/p>\n<p>Here is the basic shortcode usage:<\/p>\n<p><code>[subpages exceptme=\u201dtrue\u201d childof=\u201d253\u2033]<\/code><\/p>\n<p>The <em>Custom Sidebars<\/em> plugin is a flexible widget area manager that allows you to replace sidebars\u2014and other widget areas\u2014on your site. (Custom Sidebars works with the classic widgets screen that was used in WordPress before version 5.8. To use it with version 5.8 and above, you\u2019ll need to install the official <a href=\"https:\/\/wordpress.org\/plugins\/classic-widgets\/\" target=\"_blank\">Classic Widgets<\/a> plugin).<\/p>\n<h2><a id=\"plugin\" target=\"_blank\"><\/a>Using a Plugin for Improved Navigation on Each Subpage<\/h2>\n<p>When using the <a href=\"https:\/\/codex.wordpress.org\/Styling_Page-Links\" rel=\"noopener\" target=\"_blank\"><em>nextpage<\/em><\/a> WordPress tag, the navigation inserted at the bottom of each paginated page simply lists the paginated pages as numbers (i.e., 1, 2, 3, 4) with each page number linked appropriately.<\/p>\n<p>This works fine for breaking up a long page, but not when we want to organize the information into subpages to gain the benefits of the subpage feature and plugins. (See <a href=\"https:\/\/wpmudev.com\/blog\/pagination-how-to-split-a-wordpress-post-into-multiple-pages\/\" target=\"_blank\" rel=\"noopener\">Pagination: How to Split a WordPress Post into Multiple Pages<\/a> tutorial.)<\/p>\n<p>I used the <a href=\"https:\/\/wordpress.org\/plugins\/list-pages-shortcode\/\" rel=\"noopener\" target=\"_blank\">List Pages Shortcodes<\/a> plugin to place navigation at the top of each subpage and the parent page.<\/p>\n<p>Here\u2019s what it looks like on one of the subpages:<\/p>\n<figure id=\"attachment_209170\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-full wp-image-209170\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/Subpage-navigation-using-List-Pages-Shortcodes-plugin-1050x425.png\" alt=\"Subpage navigation on subpage using the List Pages Shortcodes plugin.\" width=\"1050\" height=\"425\" \/><figcaption class=\"wp-caption-text\">Subpage navigation on subpage using the List Pages Shortcodes plugin.<\/figcaption><\/figure>\n<p>This is the shortcode I used:<\/p>\n<p><code>[sibling-pages exclude=\"150\"]<\/code><\/p>\n<p>I chose to exclude a link to the subpage currently being displayed from these links. In this example \u201cExhibitions 2020\u20132022\u201d is <em>pageid<\/em> 150, and is excluded in the shortcode.<\/p>\n<p>One other plugin I made use of was <a href=\"https:\/\/wordpress.org\/plugins\/catch-ids\/\" rel=\"noopener\" target=\"_blank\">Catch Ids<\/a>\u2014making it easier to determine the <em>pageid\u2019s<\/em> for my parent page and subpages.<\/p>\n<p>Though some of these plugins are a year or more out from updates, we tested them (during the 2022 rewrite of this post), and they still worked as expected.<\/p>\n<h2><a id=\"summary\" target=\"_blank\"><\/a>Wrapping Up<\/h2>\n<p>So there you have it. A neat and tidy way to implement subpages and widgets, using a few handy plugins, and a bit of shortcode.<\/p>\n<p><em>Editor\u2019s Note: This post has been updated for accuracy and relevancy.<br \/>\n[Originally Published: September 2013 \/ Revised: April 2022]<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Subpages are a powerful tool for organizing a WordPress site with many useful plugins to enhance their use.<\/p>\n","protected":false},"author":132068,"featured_media":208087,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[655],"tutorials_categories":[],"class_list":["post-83262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-pages"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/83262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/132068"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=83262"}],"version-history":[{"count":15,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/83262\/revisions"}],"predecessor-version":[{"id":209177,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/83262\/revisions\/209177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/208087"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=83262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=83262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=83262"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=83262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}