Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created September 7, 2017 18:58
Show Gist options
  • Save mgibbs189/555f9649ac29fa155c1bf242e6d2a8c6 to your computer and use it in GitHub Desktop.
Save mgibbs189/555f9649ac29fa155c1bf242e6d2a8c6 to your computer and use it in GitHub Desktop.
Hide template
First, add some CSS to your theme:
.facetwp-template { display: none; }
.facetwp-template.visible { display: block; }
Then you can use this JS to dynamically add the CSS class after the first refresh:
(function($) {
$(document).on('facetwp-loaded', function() {
if (FWP.loaded) {
$('.facetwp-template').addClass('visible');
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment