Guest User

Untitled

a guest
Dec 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. /** adds css class to designate level in hierarcy fselect **/
  3. add_action( 'wp_footer', function() {
  4. ?>
  5. <script>
  6. (function($) {
  7. $(document).on('facetwp-loaded', function() {
  8. $.each( $( ".fs-option" ), function() {
  9. var label = $(this).children(".fs-option-label").first().html();
  10. if ( -1 !== label.indexOf("&nbsp;&nbsp;&nbsp;&nbsp;") ) {
  11. $(this).addClass( 'third' );
  12. } else if ( -1 !== label.indexOf("&nbsp;&nbsp;") ) {
  13. $(this).addClass( 'second' );
  14. } else {
  15. $(this).addClass( 'first' );
  16. }
  17. } )
  18. });
  19. })(jQuery);
  20. </script>
  21. <?php
  22. }, 100 );
Add Comment
Please, Sign In to add comment