Forums › Forums › Search & Filter Pro › How to filter years?
- This topic has 16 replies, 2 voices, and was last updated 5 years, 4 months ago by Trevor.
-
Trevor(Private) September 6, 2019 at 3:38 pm #220439
#1. You can use a theme template, which can be with the ‘As an Archive’ or the ‘Post Type Archive’ display results methods.
#2. You can use the Shortcode method, as your are, but then you must code the template yourself. We give you a basic template ready for such coding, which is what is in use on your page now.
#3. You can use the Custom method, and use a content plugin.Does your theme come bundled with a content/page builder plugin? Such as WPBakery Page Builder, Divi Builder, Elementor, Site Origin? Or you could use the free Post grid plugin:
https://searchandfilter.com/documentation/3rd-party/post-grid/
Trevor(Private) September 13, 2019 at 11:31 am #220940I think I understand your question now. I think a problem between us of language and translation.
You wish to know how to present the results with different style, layout and appearance, yes?
What do you want them to look like, do you have an example I can see?
Trevor(Private) September 19, 2019 at 4:51 pm #221376Those examples are using Essential Grid plugin?
For now, we do not support the Essential Grid plugin. However, I think Essential Grid has a hook we can use.
So, first remove the filter_next_query shortcode from the page:
https://www.screencast.com/t/5mIXvD4Ik4p2
Your Essential grid is ID 83 (I do not think this method can use the alias).
The Search & Filter Form ID is 7997This code can be added to your (child) theme’s functions.php file:
add_filter('essgrid_query_caching', 'eg_stop_caching', 10, 2); add_filter('essgrid_get_posts', 'eg_mod_query', 10, 2); // turn off caching for your grid function eg_stop_caching($do_cache, $grid_id) { if($grid_id == 83) return false; return true; } function eg_mod_query($query, $grid_id){ if($grid_id == 83) { $query['search_filter_id'] = '7997'; } return $query; }
I cannot be sure that this is correct, but I think it is.
-
AuthorPosts