Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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,
    Teera

    #403774

    Hey 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_Parameters

    Regards,
    Andy

    #404119

    I 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, 8 months ago by teeramusic.
    #404682

    Hi!

    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,
    Elliott

    #406297

    Thanks, that’s what I was looking for.

    #406347

    Hi!

    Glad we could help :)

    Cheers!
    Rikard

    #407834

    One 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,
    Teera

    #408928

    Hey!

    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,
    Elliott

    #411414

    In 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"});

    #411808

    Hey!

    Thanks for sharing. ;)

    Cheers!
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.