I have a webpage displaying a directory of people (custom post types) whose roles are assigned by a taxonomy (team member type: staff, board, or trainer).
A view lists all of the people and has a custom search to let visitors filter between the staff, board members, and trainers. (A screenshot is attached for reference.) Here are my questions:
+ How can I order the taxonomy terms? Right now, they're in alphabetical order (board member, staff, trainer), but I need them to be in this order: staff, trainer, board.
+ When the page with the view initially loads, it displays all people regardless of role. Can I configure the view to display only the staff people as a default?
+ Can I change the language of the taxonomy terms in the filter? For example, to rename "Board Member" to "Board Members"? Or should I just rename the taxonomy terms in the WordPress dashboard?
Hello. Thank you for contacting the Toolset support.
Can you please share problem URL where you added your view as well as admin access details.
Once I review your views configurations I will be able to guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Well - I'm not sure what question you would like to address now.
I'm on this page:
- hidden link
Can you please tell me what issue you would like to address now as I do not see "Staff People" anywhere using which you wanted to filter the posts by default.
My apologies for the confusion. The page in question is called Our People:
hidden link
The related view is "View of Team Members" (ID 633).
The questions I'd like to answer are below:
+ When the page with the view initially loads, it displays all people regardless of "role." Can I configure the view to display only Staff as a default?
+ Can I change the language of the taxonomy terms in the filter? For example, to display "Trainers" as "Our Trainers"? Or should I just rename the taxonomy terms in the WordPress dashboard?
The snippet of code did the trick! Thank you. The only thing remaining is to set the default radio button to be"Staff" (right now, none of the buttons are selected; see attached). Should I just use jQuery for that? Or is there a PHP solution?
Regarding changing the term names, I ended up using the Term Description field, where one can add anything one wants but it's otherwise hidden to users. 🙂
Thanks for your response. This solution *almost* works. It works when the page initially loads, but if I select one of the other filters (such as Trainers) and then refresh the page (which now includes a query string), the "Staff" element is always highlighted. This will be confusing for sharing direct links to display just the Trainers or Board Members.
I've adjusted the custom JS code added to your view's "Search and Pagination" section as given under:
jQuery(document).ready(function($){
var params = new window.URLSearchParams(window.location.search);
var myurl = new URL(window.location.href);
// console.log(myurl.searchParams.has('wpv-team-member-type'));
if(!myurl.searchParams.has('wpv-team-member-type')){
$('#team-member-type-staff').attr('checked', true).trigger('change');
}
});