I have several views set up to display search results of intermediary posts - they should be ordered by the post author, alphabetically. However, it's ordering by the post author ID instead of the display_name. How can I change this?
Is there any documentation that you are following?
I don't see anything exactly like this.
What is the link to your site?
hidden link
Search by any "System" and you'll see alphabetized results on the right. The results show which companies offer services in these different systems. The companies add/edit their own info and they each have a user with their company name as the Display Name - so each company user is the author. Almost all of the company users were set up at the same time, in alphabetical order, so the user ID is in order. However, the last three to be added are not in alpha order and show up at the bottom (Cenevia, Georgia Association..., New York Statewide...).
Is there a function that I could add to the child theme to pull the author display name rather than the author ID for the sorting?
Hello. Thank you for contacting the Toolset support.
As you can see the WP_Query class orderby options. You can set the posts to order by author (ID) but there is no way to order posts by author name. As to query author name it will require to query user query and we can not merge post query and user query.
=> https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
It will require custom code that is beyond the scope of our support policy. If you need custom programming for your project, please feel free to contact any of our certified partners:
- https://toolset.com/contractors/