Skip Navigation

[Resolved] Sorting a-z by CPT post type based on parent post type.

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#569105
cpt.jpg

I am trying to recreate the following (see image) and see website page: oneflare.com.au/pest-control/nsw/a

I have a CTP - for example:
"Pest Control"

The Pest Control CPT has a large number of pages for each suburb in Australia - and each has fields with more location specific date, e.g state, region, area, suburb.

The Pest Control CPT is specifically for SEO reasons and will have a view on each of the pages that shows businesses listed in each of the suburbs.

The Businesses CPT will be what is displayed in the view on the Pest Control view page.

Id like to create a page where I can list each suburb in each state (individual page) alphabetical - A- Z (as in the image) - each of the pages would link to the Pest Control CTP for each of the suburbs listed.

I would also like to have other CPT use the same logic (e.g, carpet cleaning, electricians etc).

----

Now Ive looked at all sorts of ways to do this...
E.g - create a field with A-Z on the CPT, labeling each of the states with their first letter
Create another CPT called ZtoZ and then filter based on this ... but ive just got confused and would like a fresh set of brains to point me in the right direction.

Anyone 🙂

thanks

#569184

Dear stuart,

It is possible with nested view, for example
1) you can create these:
- custom post type "pest-control",
- hierarchical taxonomy "location", and register it to post type "Pest Control",
- flat taxonomy "a-z", with below terms:
-- a
-- b
-- c
...

when you edit a "Pest Control", you will be able to setup the term of taxonomy "location" and taxonomy "a-z"

2) you can create a view to list "Pest Control" posts, filter by the taxonomy "location", and taxonomy "a-z", you can also display the posts with a nested view:
a) parent view list terms of taxonomy "a-z"
b) child view list posts which have term setup by parent taxonomy view
see our document:
Views Inside Views – Display Nested Multidimensional Lists
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/