Listable – redirect if only 1 result

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (! FWP.loaded && 1 === FWP.settings.pager.total_rows) {
window.location = $(‘.facetwp-template article:first’).attr(‘data-permalink’);
}
});
})(jQuery);
{{/gist}}