-
AuthorPosts
-
February 27, 2015 at 7:49 am #403222
What are the names of the functions responsible for filtering the categories / tags in the portfolio? I want to call them using my own script. (basically I want to have a search box)
Thanks,
TeeraFebruary 28, 2015 at 2:21 am #403774Hey teeramusic!
I am not sure what you want to achieve, can you please explain further? Do you want to change the order of portfolio categories? if yes go to config-templatebuilder > avia-shortcodes > portfolio.php and search for line 556.
More infos: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_ParametersRegards,
AndyMarch 1, 2015 at 6:00 pm #404119I am misunderstood… Here’s what I mean – When you have a portfolio, you can filter categories. The links are simple a href links, ie:
<a href="#" data-filter="advertising-tv_sort" class="advertising-tv_sort_button"><span class="inner_sort_button"><span>Advertising</span><small class="av-cat-count"> 5 </small></span></a>
But there is a event watcher that calls the JS function that actually makes everything work. I want to know what this function is and how to call it from my own JS script.
Thanks,
Teera- This reply was modified 9 years, 9 months ago by teeramusic.
March 2, 2015 at 6:37 pm #404682Hi!
It’s pretty complex and would have to be considered custom work but if your just wanting to know the location of the function that actually does the filtering then it’s on line 1159 in /enfold/js/shortcodes.js.
Regards,
ElliottMarch 5, 2015 at 10:06 am #406297Thanks, that’s what I was looking for.
March 5, 2015 at 12:19 pm #406347March 9, 2015 at 4:03 am #407834One more question, I’ve got most of what I want now, but is there a way to output the WP tags in the portfolio entries into the class property of the divs that are the portfolio entries (isotope-item)?
Thanks again,
TeeraMarch 10, 2015 at 4:42 pm #408928Hey!
It sounds like your talking about line 412 in the portfolio.php file.
$post_class = "post-entry post-entry-{$the_id} grid-entry-overview grid-loop-{$post_loop_count} grid-parity-{$parity} {$last}";
Best regards,
ElliottMarch 14, 2015 at 7:02 am #411414In case anyone is also interested in outputting the tags in the classes of the DIV, here is my code for protected function sort_cat_string($the_id, $params) in portfolio.php
protected function sort_cat_string($the_id, $params) { $sort_classes = ""; $item_categories = get_the_terms( $the_id, $params['taxonomy']); $item_tags = get_the_tags($the_id); if(is_object($item_categories) || is_array($item_categories)) { foreach ($item_categories as $cat) { //fix for cyrillic, etc. characters - isotope does not support the % char $cat->slug = str_replace('%', '', $cat->slug); $sort_classes .= $cat->slug.'_sort '; } } //Output tags too if(is_object($item_tags) || is_array($item_tags)){ foreach ($item_tags as $cat) { //fix for cyrillic, etc. characters - isotope does not support the % char $cat->slug = str_replace('%', '', $cat->slug); $sort_classes .= $cat->slug.'_tag_sort '; } } //New code end return $sort_classes; }
For isotope functions, use regular isotope methods on .isotope and .isotope_activated
$('.isotope').isotope({filter: "." + search_term + "_sort"});
March 16, 2015 at 3:14 am #411808 -
AuthorPosts
- You must be logged in to reply to this topic.