FacetWP – style top-level checkbox items

mgibbs189

{{gist file=”functions.php” lang=”php”}}
add_action( ‘wp_head’, function() {
?>
<script>
(function($) {
$(document).on(‘facetwp-loaded’, function() {
$(‘.facetwp-type-checkboxes > .facetwp-checkbox’).each(function() { // top-level terms
$(this).find(‘.facetwp-counter’).hide(); // hide the counter
$(this).after(‘<div class=”is-divider small”></div>’); // add the separator
$(this).css({ // add some extra styles
‘font-size’: ‘1em’,
‘font-weight’: ‘600’,
‘line-height’: ‘1.05’,
‘letter-spacing’: ‘.05em’,
‘text-transform’: ‘uppercase’,
‘padding-left’: ‘0px’,
‘background’: ‘none’,
‘margin-top’: ’20px’
});
});
});
})(jQuery);
</script>
<?php
}, 100 );
{{/gist}}