Loop results based on taxonomy count
-
I have a custom post type and this custom post type has a taxonomy cities. What I want is to show the loop with the post types first which has the most frequent taxonomy. For example:
When I count the taxonomies from my custom post type it looks something like this:
Haarlem 12x
Leiden 10 x
Amsterdam 8x
Rotterdam 6x
etc….How can I display the loop that all posts with the taxonomy Haarlem are on top and then Leiden, Amsterdam, Rotterdam etc
Can I do this with pre_get_posts?
- The topic ‘Loop results based on taxonomy count’ is closed to new replies.