- This topic has 5 replies, 2 voices, and was last updated 6 years, 3 months ago by Harvey.
August 22, 2017 at 2:06 pm #371520Harvey
I’m using GPPro/Pods/BB/BT for a site. Pods serves for CPTs. One Pod is for reference books related to the subject of the site. I can’t figure out how to get the reference books in alpha order by book (Pod) title.
Jim True over at Pods suggests doing something via a GP Hook in GP Premium. He put these words in my mouth: “I’d like to override the sort in the WP Query for the archive depending on post type.” Is this possible using one of the GP Hooks in Generate Press Premium?
I’ve just discovered WP Show Posts and now I’m wondering if this is a problem I could solve with WPSP.
HarveyAugust 23, 2017 at 12:02 am #371709TomLead DeveloperLead Developer
You would have to use the pre_get_posts filter most likely: https://wordpress.stackexchange.com/a/180609/90661
GP Hooks is for elements you can see – functions like this would have to be added using one of these methods: https://docs.generatepress.com/article/adding-php/August 23, 2017 at 2:39 pm #372205Harvey
Well, drat! Got it. I’ve got a couple of dozen CPTs to construct and each one needs to be sorted in some human-sensible fashion. Sorting posts, pages and CPTs in something other than descending date order is an obvious need in a general-pourpose CMS. Expecting non-programmers to do what this calls for (and debug it) seems like proof that WP still has a ways to go.
Reminds me of a visit of Peter Norton to a Houston PC club meeting. We were several thousand who had to come to hear one of the great names in PC software back in the 90s. He looked out over the crowd and said, “You’re evidence that the personal computer is not yet ready for prime time. There are no microwave user groups or washing machine user groups.”
HarveyAugust 23, 2017 at 8:43 pm #372358TomLead DeveloperLead Developer
Yea, an option for sorting like this should definitely be in WP core.
Glad I was able to help though 🙂August 24, 2017 at 9:51 am #372777Harvey
Just stumbled on a plugin that seems to offer what’s neede without fiddling with a WP filter each time I add a CPT. Apparently Admin Columns Pro provides the ability to sort output from Pods based on Post Title. If you get a chance (not urgent), take a look and leave a comment.August 25, 2017 at 10:31 am #373448Harvey
Final post on this subject: Also discovered the plugin Post Types Order at wordpress.org that is supposed to sort CPTs.
However, I’m going to experiment with the Posts modules of BvrBldr, UABB and PowerPack to see if the custom query with its sort parameter is sufficient.
- You must be logged in to reply to this topic.