On my website, the "Sort By Category" works OK when your checking the checkboxes it appends each of each category and hides the rest of the other one.
What I want to do is be able to show all if category items if none of the checkboxes are check, if you go on the site and click on 2 categorys and uncheck them you will notice it will be empty.
The CSS item for the posts is the class = "rp-item".
This is what my category sort looks like right now,
function categorySort() {
$('#CategorySort').attr('firstclick', true);
$('.cat-sort-toggle').click(function() {
$('.cat-sort-bar').toggle(500);
});
$('.cat-sort-check').change(function() {
if ( $('#CategorySort').attr('firstclick') == 'true') {
$('.rp-item').css('display', 'none');
$('#CategorySort').attr('firstclick', false);
}
$objectString = '.' + $(this).attr('showclass');
if ( $(this).is(':checked') ) {
$($objectString).show(500);
} else {
$($objectString).hide(500);
}
});
}
/* the code below was the one i tried to fix the issue,
what it did is it kinda worked but everytime i click the
2nd time on any of the check boxes or just switch
checkboxes it brings everything back instead of only
the posts from the checkbox. Thanks! */
else{
$('.rp-item').css('display', 'inline-block');
$('#CategorySort').attr('firstclick', true);
}