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"
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
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.
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
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?
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