Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active August 27, 2020 13:20
Show Gist options
  • Save mgibbs189/d992836bfe7a67774f69de896b57f6fa to your computer and use it in GitHub Desktop.
Save mgibbs189/d992836bfe7a67774f69de896b57f6fa to your computer and use it in GitHub Desktop.
Add submit button after search input
<?php
add_action( 'wp_head', function() {
?>
<script>(function($) {
$(document).on('facetwp-loaded', function() {
$('.facetwp-input-wrap').each(function() {
if ($(this).find('.facetwp-search-submit').length < 1) {
$(this).find('.facetwp-search').after('<button class="facetwp-search-submit" onclick="FWP.refresh()">Submit</button>');
}
});
});
})(jQuery);
</script>
<?php
}, 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment