How To Create a Custom List of WordPress Pages
By creating a list of pages, you can make it easier for your site’s visitors to find what they’re looking for. With Toolset, you can display a visually appealing, custom, and dynamic list of pages on your WordPress site.
As your site grows, you may find yourself with a bunch of pages you’d like to create a custom list out of.
Here are some examples of this on actual sites:
Index of pages grouped under a parent page
Subpages of an account page
Contact pages with different forms, each grouped under a parent page
Gallery-like page with subpages acting as “album” subcategories
Manually creating custom lists of these pages could be time-consuming, especially if you have a lot of content. And what if any of the listed pages change, new ones get added, or some get deleted? Wouldn’t it be great if you could display a list that is dynamic and adapts automatically?
Here’s where the Toolset View block comes to the rescue. With a View, you can display pages from the database on the front-end in the form of a fancy list, in a grid, or however you like.
Sure, there is now a WordPress Query block but as you probably know, it has pretty basic features.
Why You Should Use The View Block
You might be thinking, “Why use the View block? Isn’t that what we have custom post types for?”. In a sense, that is true.
In most cases, you could use post types for each potential group of your pages. However, sites don’t always evolve the way we expect them to. It’s not uncommon to start with just a few pages and subpages. Then, once your site starts to grow, you suddenly realize you’ve been left with countless subpages.
Let’s be honest with ourselves – updating the index of a group of pages could quickly become a hassle. Ideally, your list of pages should be updated automatically whenever you add a new page.
The Toolset View block tells your website what information to dynamically display. It can loop through a lot of information, sort it out, and display what you filter for – not to mention the aspect of visual design. With the Toolset View block, you can also decide how you want to display your information.
Let’s take a look at this contact page.
A parent page with sub-pages on the front-end
A parent page with sub pages on the backend
As you can see, it has three sub pages displayed in the form of a nice list on the front-end. Because other blocks with dynamic sources have been inserted into the View block, it also displays additional information, like the featured image and page excerpt.
Organizing Your WordPress Pages
Before you display a list of pages, take a second to think about how you would group them. It’s likely you don’t want to create a list of all the pages on your site.
Here are a couple of examples of ways that may work for you:
- Create subpages under a parent page. You can do this when you’re editing a page. In the right-hand sidebar, locate the Page Attribution section and select a Parent Page.
- Assign Pages to categories or custom taxonomies by going to Toolset → Taxonomies.
How To Create a Dynamic List of Pages Using a View Block
You can follow these steps:
- Open a page for editing.
- Insert the View block and give it a name. Then, click on Create View.
- In Select View Loop Style, choose the Unformatted option.
- In Choose content this View will display, select Pages.
- Add the Toolset Heading block inside the View Loop area.
- From the Heading Settings section in your right sidebar, toggle Dynamic Heading Text and select Post title with a link as the source.
- Use the block navigation to locate and select the View block.
- In your right sidebar, expand the Content selection section.
- Click on Add a filter.
- To select pages for a specific parent, choose Filter by: Post parent and then select the Parent is the page where this View is shown option. Alternatively, if your pages use categories or a custom taxonomy, you can select the taxonomy filter.
- Use the sidebar to style your Heading block.
- Feel free to add any other blocks connected to dynamic sources to display more information about your pages. For example, you can choose to display the page’s featured image.
Hint #1 – Create Interesting Layouts
You can use the Toolset Grid block inside your View Loop to create interesting layouts:
Hint #2 – List Your Sub Pages in a Specific Order
If you want your subpages to be listed in a specific order, use the Order field under the Page Attribute section on each of your subpages. Then, in the Ordering section of your view select Sort By: Menu order and Sort Direction: Ascending.
You can also avoid opening each and every one of your pages for editing by using the WordPress Quick Edit feature and changing the Order.
Toolset’s View block allows you to create a dynamic list of pages. You can then organize your subpages in any specific order. If you’re looking to spice things up, add the Toolset Grid block inside your View to create interesting layouts! Or, display more information about your pages, such as their featured images, by adding other blocks connected to dynamic sources.
Best of all, thanks to Toolset, you can achieve all this without any coding!
To see other ways you can use the View block, check out our course about Creating Custom Lists of Directory Items with Views.
This article is a part of an ongoing series where we present interesting and powerful ideas of what you can build with Toolset. We’re publishing these every few weeks, so stay tuned!
Other articles in this series:
- 3 Tips For Creating Magazine-Like Layouts
- 3 Non-Obvious Applications of Post Relationships in WordPress
- Design Beautiful Headers and Footers For Your Toolset Site
- How To Build A Custom Category Tree With Toolset
- How To Build A Truly Custom WooCommerce Store
- 3 Dynamic Designs Using Kadence Blocks To Inspire Your Website
- 5 Advanced Uses of Toolset’s Conditional Block in WordPress