Add “Clear” button for Shuffle Filter Checkboxes

Content Views Pro helps you to show taxonomies as filter options easily. You can display these options in many type of output, one of them is checkboxes, which you can see live sample here.

To add “Clear All Filters” button before the filter bar, please:

  • Add this HTML before the View shortcode:
    <a href="#" class="clear-filter" id="clearFilters">Clear All Filters</a>
    [pt_view id="YOUR_VIEW_ID"]
    
  • Add this code to Custom JS field in Content Views >> Settings page:
    window.sf_enable_trigger = true;
    $('.clear-filter').on('click',function(){
    var $last_checked = $('.pt-cv-filter-option.selected').last();
    $('.pt-cv-filter-option.selected').not($last_checked).removeClass('selected');
    $last_checked.trigger('click');
    });
    

Best regards,