Created
January 25, 2021 23:17
-
-
Save djrmom/30bc567b24091f6b9256d52a3841de46 to your computer and use it in GitHub Desktop.
facetwp make result in layout builder clickable
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
/** | |
** adds click even to each facetwp layout builder result to trigger | |
** a click on the first link within the result | |
**/ | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
$( '.facetwp-template' ).on( "click", ".fwpl-result", function() { | |
$(this).find('a:first')[0].click(); | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment