my directory page is a Blog for Book Reviews.
Therefore I created the Custom Post Type "Reviews" contain the custom fields group "Book author" with the field "Lastname".
I created a page that should show the list of all book authors. To keep it handy I wann put it into a accordion. So that a have a section A-B-C and D-E-F and so on.
If I am using the "between" criteria and link it to a beginning and ending statement/variable it works in generell OK.
In the accordion I state: [wpv-view name="View_Buchautoren" begin="A%" end="D%"] for A-B-C
If I limit to "C%" it will not show author's lastnames starting with "C" whyever.
Question 1: --> How to solve it for Y-Z?
Question 2:--> How am I getting a DISTINCT statement into the query?
Hello. Thank you for contacting the Toolset support.
Do you mean that when you set your view to start with A and end with C, you expect to see the posts with last name start from A,B and C but in that case the posts that starts C in lastname is not showing?
In the accordion I state: [wpv-view name="View_Buchautoren" begin="A%" end="D%"] for A-B-C
==>
If you are using above method that helps you to display posts starts with A and C, its correct.
As you can see with the following link:
- hidden link
And try to run the query:
SELECT * FROM Customers
WHERE CustomerName Between "A%" and "D%"
It shows the results where CustomerName starts with A,B and C. So, the method you are using is correct I believe and how it suppose to work.
If you want to solve it, then I think we need to add hook to modify the query and instead of using between we have to use the like operator with or clause.
Question 2:--> How am I getting a DISTINCT statement into the query?
--
I'm not sure what you are saying here, the queries will be automatically generated by views so you should not worry about.
Yes, I would like to switch to "LIKE" with "or" but unfortunately I cannot find a documentation that tells me the right syntax (for the shortcode) and all my attempts failed. Question 1 (again) Can your please tell be how the short code must look like?
Question 2:
Distinct means, that of 2 or more posts have the same author (lastname) I only wanna have the name appear only once.
Yes, I would like to switch to "LIKE" with "or" but unfortunately I cannot find a documentation that tells me the right syntax (for the shortcode) and all my attempts failed. Question 1 (again) Can your please tell be how the short code must look like?
==>
Well - for that we will require to use the hook wpv_filter_query.
Can you please share problem URL where you added your view and temporary admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.
Question 2:
Distinct means, that of 2 or more posts have the same author (lastname) I only wanna have the name appear only once.
==>
Ahh ok.
Last litte question. I am usually using the iThemes security plugin. In my sandbox have deactivated the Plugin to your convenience. Unfortunately I believe that your custom code is inhibited by iThemes. Any idea by chance witch section this could be?
We can entertain only one question per ticket. This will help other users searching on the forum. Please kindly open a new ticket with every new question you may have. Thank you for understanding.
I'm not sure what you mean exactly, do you mean that itheme security has remove the custom code I added?