Display custom posts from a custom taxonomy, sorted by another custom taxonomy
-
Hi I am working on a new WordPress site where there is a Nature section which shows photos of various nature elements.
There are loads of posts, each depicting a picture of something, eg a moth, a butterfly, a tree, a wasp etc.
So the way I have set this up is to create a custom post type of “Nature Post”. Then set up several custom taxonomies – Group, Order, Family, Species amongst others.
So I might have the following –
Group Order Family
—– —– ——
Insect Lepidoptera NOCTUIDAE
Insect Lepidoptera CRAMBIDAE
Bird Galliformes PHASIANIDAE
Bird Passeriformes SITTIDAESo on each post I display each of the custom taxonomy values as a hyperlink so you can see all of Lepidoptera for example.
What I want to be able to though is to be able to sort the display of posts a number of different ways – so for example I would like to be able to display a page of Lepidoptera, sorted by Family. So in essence take the posts which form a subset of a custom taxonomy, and sort them by the values of another custom taxonomy that applies to the same posts.
I’d be grateful for any advice here. Thanks in advance.
- The topic ‘Display custom posts from a custom taxonomy, sorted by another custom taxonomy’ is closed to new replies.