Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** adds css class to designate level in hierarcy fselect **/
- add_action( 'wp_footer', function() {
- ?>
- <script>
- (function($) {
- $(document).on('facetwp-loaded', function() {
- $.each( $( ".fs-option" ), function() {
- var label = $(this).children(".fs-option-label").first().html();
- if ( -1 !== label.indexOf(" ") ) {
- $(this).addClass( 'third' );
- } else if ( -1 !== label.indexOf(" ") ) {
- $(this).addClass( 'second' );
- } else {
- $(this).addClass( 'first' );
- }
- } )
- });
- })(jQuery);
- </script>
- <?php
- }, 100 );
Add Comment
Please, Sign In to add comment