FacetWP – override the Listable template on normal pages

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php
// Add to your theme’s functions.php
function fwp_override_template() {
?>
<script>
(function($) {
$(function() {
wp.hooks.addAction(‘facetwp/ready’, function() {
if (‘stock_photos’ == FWP_HTTP.uri) {
FWP.template = ‘stock_photos’;
}
});
});
})(jQuery);
</script>
<?php
}
add_action( ‘wp_head’, ‘fwp_override_template’, 50 );
{{/gist}}