Last active
February 18, 2019 19:18
-
-
Save djrmom/f4b8b293a674f325398c23478676748b to your computer and use it in GitHub Desktop.
facetwp modify slider label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <php | |
| /** add js to wp_head to modify slider **/ | |
| add_action( 'wp_head', function() { ?> | |
| <script> | |
| (function($) { | |
| $(function() { | |
| FWP.hooks.addAction('facetwp/set_label/slider', function($this) { | |
| var label = $this.find('.facetwp-slider-label').html(); | |
| var regex = /(^[^\s]+)/; | |
| label = label.replace(regex,"<span class=\"slider-min\">$1</span>"); | |
| $this.find('.facetwp-slider-label').html(label); | |
| }); | |
| }); | |
| })(jQuery); | |
| </script> | |
| <?php }, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment