FacetWP – show pager on pageload

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Generate the pager on pageload
add_filter( ‘facetwp_render_params’, function( $params ) {
$params[‘extras’][‘pager’] = true;
return $params;
});

// Store the pager variable
add_filter( ‘facetwp_render_output’, function( $output, $params ) {
FWP()->pager_html = $output[‘pager’];
return $output;
}, 10, 2 );

// IN TEMPLATE: output pager
echo FWP()->pager_html;

{{/gist}}