-
AuthorPosts
-
February 25, 2014 at 7:46 pm #229161
Hello,
I have a very specific need when defining a portfolio grid by selecting multiple categories. My need is that the selected categories work in conjuction to each other. Therefore, i want the filter to be AND. I do not want to the outcome to be a list of EACH selected category.
February 26, 2014 at 6:04 pm #229668Hi svdevelopment!
Unfortunately that isn’t possible with the current implementation of the sorting method.
Regards,
DevinFebruary 28, 2014 at 11:30 am #230547Thank you for your reply.
However, since this is of great importance to us, could you please guide me to the php function that executes the select query for the portfolio grid.
And also, there is a second issue with that we are trying to implement. Is it possible to have a single page with a portfolio grid and have the category for that grid automatically selected by passing parameters to that page from the page that calls it?
Regards,
svdevelopmentMarch 3, 2014 at 11:01 am #231462Hi!
1) The sort/filter feature is based on js/jquery and does not use php or ajax. You can modify the code in enfold/js/avia.js – search for:
$.fn.avia_iso_sort = function(options)
If you just want to modify the query which displays the grid items you can modify the operator in wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php – search for:
'tax_query' => array( array( 'taxonomy' => $params['taxonomy'], 'field' => 'id', 'terms' => $terms, 'operator' => 'IN')));
and change the operator parameter
'operator' => 'IN'
to
'operator' => 'AND'
You can also use a filter function in your child theme:
add_filter('avia_post_grid_query', 'avf_custom_post_grid_query'); function avf_custom_post_grid_query ( $query ) { if(!empty($query['tax_query']['operator'])) $query['tax_query']['operator'] = "AND"; return $query; }
2) No, it’s currently not possible to pre-select a category by passing a parameter. However I’m sure you can implement it with some hours of work (maybe 2-3 hours including testing).
Cheers!
Peter -
AuthorPosts
- You must be logged in to reply to this topic.