Show results of FacetWP by Content Views Pro layout

You can use Content Views Pro to display the results of FacetWP plugin. Here are steps:

1/ Browse to Settings > FacetWP, then click the “Templates” tab, backup the code in “Display Code” to somewhere.

2/ Replace “Display Code” content with this:

<?php
if ( shortcode_exists( 'pt_view' ) ) :
	$pids = array();
	while ( have_posts() ) :
		the_post();
		$pids[] = get_the_ID();
	endwhile;
	echo do_shortcode( '[pt_view id="VIEW_ID" post_id="' . implode( ',', $pids ) . '"]' );
else : ?>
	Paste the backed up content (in step 1) here
<?php endif; ?>

3/ replace VIEW_ID with ID of the View (which will be used to show FacetWP results).

Notice: The results and pagination depend on the FacetWP plugin, therefore Filter Settings, Pagination settings in View will not be applied.

Thank you,