Skip Navigation

[Resolved] Posts filtered by taxonomy can't be ordered

This support ticket is created 7 years, 8 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)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 7 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#413923
Screen Shot 2016-07-06 at 4.24.10 PM.png
Screen Shot 2016-07-06 at 4.23.47 PM.png

I am trying to change the order of posts in a child view. This child view is filtered by taxonomy set by the parent view. Changing the Order by setting in the child doesn't result in any changes.

The hierarchy is as such: WP Archive > Parent View (List of taxonomy items) > Child View (List of items for the given taxonomy > Loop item Content Template

I visited this URL: hidden link

I expected to see: Changes in order of people within each grouping.

Instead, I got: no changes

In the attached images, the detailed screenshot is of the "Sectioned Team Member Results"

#414010

Dear Andrew,

First, the normal view will not work as expected in wordpress archive page.

How do you setup the " WP Archive", are you using the Views wordpress archive?
Could you take a screenshot for it? thanks

#419335
sectioned-team-member-results-loop.png
team-members-parent-loop-content.png
Team-member-wordpress-archive-loop-content.png

Yes, I am using a WordPress archive. It includes a view in the loop ("team-members-parent" which displays the taxonomy "Departments"). In the "team-members-parent" loop another view ("sectioned-team-member-results") is displayed for each Department. It is in this view, "sectioned-team-member-results", I'm trying to order items.

#419502

I assume we are talking about this case:
Three level nested view
1) 1st level WP Archive
2) 2nd level taxonomy view, List of taxonomy items, this is a normal taxonomy view.
3) 3rd level post view, list posts of given term, this is a normal post view

And you are displaying the 2) and 3) normal views in the wordpress archive page, as I mentioned above, the normal view (2 and 3) won't work as expected in the wordpress archive page. but you can use Views filter hook wpv_filter_query to force the normal view to order as what you want, see our document:
wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

And wordpress document:
Order & Orderby Parameters
https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

#419790

So I could use wpv_filter_query in my theme functions and provide view_settings arguments? Do you have an example of proper syntax for view_settings in this scenario?

#419830

I just test it in my localhost, but can not duplicate same problem:
Changing the Order by setting in the child doesn't result in any changes.

And if I change the order by setting in the child view (3rd level post view, list posts of given term), it does change the order of result in front-end, I suggest you try this in your website:
deactivate other plugins and switch to wordpress default theme, and test again

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.