// facetwp_template_html

Overview

This filter lets you override a FacetWP template’s output.

Parameters

  • $output | string | The output HTML
  • $class | object | The FacetWP_Facet class instance

Usage

add_filter( 'facetwp_template_html', function( $output, $class ) {
    $GLOBALS['wp_query'] = $class->query;
    ob_start();
?>
    <?php while ( have_posts() ): the_post(); ?>
    <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
    <?php endwhile; ?>
<?php
    return ob_get_clean();
}, 10, 2 );