Good afternoon, I’m creating an “Areas” page on my WordPress website with a page structure like this;
Home About Us Areas
- Wiltshire
-- Salisbury
-- Wilton
- Hampshire
-- Andover
-- Portsmouth
I’m looking for a way to generate all the links on the areas page with the parent of the town being the Title!
For example
<h2>Wiltshire</h2>
<ul>
<li><a href>Salisbury</a></li>
<li><a href>Wilton</a></li>
</ul>
What is the best way to generate these links within WordPress?
Create the pages and then create a custom menu. Once registered add the menu items. Most themes have a navigation menu up the top. You can find the code which registers it in
functions.phpof the theme directory. If your pages have different functionality to regular pages, consider registering a custom post type and adding those instead of regular pages.