facetwp woocommerce facetwp-template with hooks

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php

/** wrap main content with facetwp-template class **/
add_action( ‘woocommerce_before_main_content’, function() {
if ( !is_singular() ) { ?>
<div class=”facetwp-template”>
<?php }
}, 10);

add_action( ‘woocommerce_after_main_content’, function() {
if ( !is_singular() ) { ?>
</div><!– end facetwp-template –>
<?php }
}, 10);
{{/gist}}