extended-cpts
extended-cpts copied to clipboard
Sorting not working on single tem page
Hi,
I have CPT called team
with taxonomy profession
. Then, I added an ACF field sorting_name
that I wanted to sort by, and the last step I added:
'site_sortables' => ['sorting_name' => array(
'meta_key' => 'sorting_name',
'default' => 'ASC',
)],
On main archive page /team
new sorting works fine, but when I go to any category of 'profession' eg. /profession/office
the list of posts is sorting by title as it was before.
any suggestions how to fix this ?
Thanks for the report. Off the top of my head I'm pretty sure that sorting only applies to the main post type archive, not a term archive for the post type. Technically the term archive could include other post types.
It makes sense for this to apply to term archives too, though. Unfortunately I don't have any time to implement this at the moment nor any time soon, but PRs are welcome.