Hello, I am attempting to add a simple js filter to my localhost (stage site)
this is working outside of wordpress however, when I add the JS to the JS section of
the pro theme it does not work AT ALL.
JS
$(".filter-button").click(function(){
var value = $(this).attr(‘data-filter’);
if(value == "all"){
$('.filter').show('1000');
}else{
$(".filter").not('.'+value).hide('3000');
$('.filter').filter('.'+value).show('3000');
}
if ($(".filter-button").removeClass("active")) {
$(this).removeClass("active");
}
$(this).addClass("active");
});
});
Buttons
<button class="filter-button" data-filter="all"><a class="fa fa-check-square"> All Recipies</a></button>
<button class="filter-button" data-filter="test"><a class="fa fa-check-square"> Test</a></button>
<button class="filter-button" data-filter="3"><a class="fa fa-check-square"> Test2</a></button>
Divs
<div class="x-promo-image-wrap"><img src="'.$RecipieImage.'"></div>
<div class="x-promo-content">
<h2><span style="color: #ffffff;">'.$RecipieName.'</span></h2>
<p>'.$RecipieDescription.'</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<p><button>Read More</button></p>
</div>
</div>
</div>';
This line is where it should be applying a filter called Test,
<div class="el13 x-column x-sm x-1-3 filter test">
As I mentioned earlier this site is on a local test envrioment so i am unable to give access to it. so help before I put it on a live server would be great, HOWEVER if need be i can get it on a live server