How can we help?
If you are looking for support for our PokaTheme, this is the place!
Home › Forums › PokaTheme support › Filter
- This topic has 7 replies, 2 voices, and was last updated 2 years, 11 months ago by
Christopher Witte.
- AuthorPosts
- February 4, 2018 at 12:49 pm #1457
Christopher Witte
ParticipantHi,
Do you have any suggestions on how to build a filter for the reviews?
I want to be able to filter by bonus amount, Minimum Odd – i want to be able to filter on all the “numeric” information on the site.
Is this possible? Is there a good plugin for this or can i edit the theme to achive this?
Best
ChrisFebruary 6, 2018 at 8:18 am #1467admin
KeymasterHi Christopher,
You want to change the display order in a shortcode by some custom fields? For example the ordering in the table shortcode?
February 7, 2018 at 7:23 am #1472Christopher Witte
ParticipantExactly!
And maybe even more user-friendly by allowing the user to filter the bonuses from a menu.
What i mean is something like this:
February 7, 2018 at 8:50 am #1476admin
KeymasterAbout the shortcode, tell me which shortcode you want to change the order and what custom ordering you want to achieve and I’ll help you through!
We are also thinking creating a new table like shortcode with filters like the screenshot, It’s already in our list! 🙂
February 7, 2018 at 10:24 am #1477Christopher Witte
ParticipantThanks!
I want to change the order in the table shortcode; [table_list num=”10″ sort=”rating” big_table=”true”]
If i, for example, want to add the custom input “Minodds” – and filter the table based on that amount – how do i do this? 🙂
February 13, 2018 at 3:44 pm #1500admin
KeymasterFirst you have to override the entire function “tablelist” from the file sc-table-list.php to your child theme functions.php
After that find the following:
` } elseif($sort == “date”) {
$query_string[‘orderby’] = “date”;
$query_string[‘order’] = “ASC”;
}`and change it to:
` } elseif($sort == “date”) {
$query_string[‘orderby’] = “date”;
$query_string[‘order’] = “ASC”;
} elseif($sort == “minodds”) {
$query_string[‘meta_key’] = “your_custom_field_name”;
$query_string[‘orderby’] = “meta_value_num”;
$query_string[‘order’] = “DESC”;
}`Don’t forget to change “your_custom_field_name” with your custom field name and after that you can use it as follow:
`[table_list num=”10″ sort=”minodds” big_table=”true”]`February 18, 2018 at 12:03 pm #1534Christopher Witte
ParticipantThanks a lot!
I just addded my custom fields into the acf-metaboxes.php and now i can use the shortcode to sort them.
I also tried making a short php script so that i can press a button and display different lists. Do you have a suggestion on how i can do this?
If i want two buttons that says “Sort Minodds” and “Sort Rating” – that displays these different shortcode objects:
[table_list num=”10″ sort=”minodds” big_table=”true”]
[table_list num=”10″ sort=”rating” big_table=”true”]Is this possible with a simple code?
And thanks for the great support so far! 🙂
February 19, 2018 at 7:18 pm #1542Christopher Witte
ParticipantNevermind the question above! I solved it 🙂
- AuthorPosts
- You must be logged in to reply to this topic.