On this page under the videos we list success stories (also referred to as 'testimonials'):
hidden link
We have 'success story categories' set up for each testimonial. I want to list the testimonials by success story category and not Post date. When I go into edit the toolset view to setup a query filter I am having an issue. When I say 'Add A Filter' and then 'filter by' the Taxonomies dropdown area is blank. However, I can see the success story category setup and working properly in the backend.
This is what I am trying to do:
With the testimonial toolset view I want the display the testimonials by category in this order:
1. back-body-pain category
2. fatigue category
3. rest of the testimonials by post date desc
Thank you!
Hi,
Thank you for contacting us and I'd be happy to assist.
There is no built-in feature available to order the view's results based on the attached taxonomy term, so to achieve ordering like this, you'll need some custom workaround.
For example, you can add a new number type custom field for example "Order Priority" and:
1. for all the testimonial posts with the back-body-pain term, save '1' in this field.
2. for all the testimonial posts with the fatigue term, save '2' in this field.
3. for all the testimonial posts which don't have those two terms, save '3' in this field.
After that, you'll be able to set the ordering field to use this new "Order Priority" field (in ascending order), and the secondary sorting field to use the post date.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thank you for your reply. I am confused as we have testimonials displaying on our homepage based on the category 'Featured'.
On the homepage (hidden link) under 'Success Stories' you will see a carousel with testimonials based on the 'featured' success story category. This is called up with the following shortcode:
[wpv-view name="testimonial-slider" view_display="layout" successcat="featured" ]
There is a filter created that sets the shortcode 'successcat'. I have included an image of the filter from the homepage. I am having a hard time recreating this filter for my view. This is what I want to do.
Please advise.
Thanks for writing back and I apologize for the confusion.
From your earlier message, I thought the query filter for the view is in place and now you want to show the results ordered by taxonomy terms. Filtering and ordering are two separate things.
Your view "Filterable Testimonials" already includes a query filter for the taxonomy "Success Story Categories", as can be seen in your screenshot from the first message.
( screenshot: hidden link )
That query filter is set that way because it is dependent on what is selected in the front search filter field.
( screenshot: hidden link )
In a view, it is possible to include only a single query filter for taxonomy or field. This is why the option to add another taxonomy filter for the "Success Story Categories" is not available in that view.
And a taxonomy filter can either be linked to the front-end search field (like in the view "Filterable Testimonials") or a views shortcode attribute (like in the carousel view for the testimonials on the homepage). But, it is not possible to use both types of filtering for a single taxonomy in a single view.
I hope this makes it more clear.
Thanks.
I want the testimonials that show on the /testimonials page brought up by the 'Filterable Testimonials' to initially show the 'Back/Body Pain' and 'Fatigue' categoreies.
hidden link
How do I make that happen? Do I have to implement the sorting you mentioned above? I am just worried that the admins adding testimonials in the future will not remember to update the sorting field as that is a small detail.
To automatically select the 'Back/Body Pain' and 'Fatigue' category options when the page loads, you can add the following script, in the view's "JS editor":
( example screenshot: hidden link )
jQuery( document ).ready(function() {
jQuery('.wpv-filter-form input[name="wpv-success-story-category[]"][value="back-body-pain"]').prop('checked', true);
jQuery('.wpv-filter-form input[name="wpv-success-story-category[]"][value="fatigue"]').prop('checked', true).trigger('change');
});
Thank you so much! So far so good. This is just what we needed. I am letting the users test it out and will let you know if I run into any issues. Thank you for you patience and persistence.
Thanks for the update and glad I could help.
Let me know if you have any follow-up questions and for a new question or concern, you're welcome to start a new ticket.