Reputation: 201
i'm using the following implementation of isotope to include an isotope grid on my wordpress site that filters by tag, using three select menus. This all works great but can anyone give me some guidance on adding the BBQ plugin to enable me to link to predefined filters from other pages. I have tried a few variations but am not sure how to use my existing code alongside BBQ. Thanks for your help guys!
jQuery(function ($) {
var $container = $('#isotope-list'); //The ID for the list with all the blog posts
$container.isotope({ //Isotope options, 'item' matches the class in the PHP
itemSelector : '.item',
layoutMode : 'fitRows',
});
//Add the class selected to the item that is clicked, and remove from the others
var $optionSets = $('.group'),
$optionLinks = $optionSets.find('option');
$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var $optionSet = $this.parents('.group');
$optionSets.find('.selected').removeClass('selected');
$this.addClass('selected');
//When an item is clicked, sort the items.
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
});
Upvotes: 0
Views: 102