facetwp different posts per page on initial load

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
/**
** requires at least 3.0.4
**/
add_filter( ‘facetwp_query_args’, function( $query_args, $class ) {
if ( ‘posts_template’ == $class->ajax_params[‘template’] && empty( $class->facets ) && $class->is_preload ) {
$query_args[‘posts_per_page’] = 1;
}
return $query_args;
}, 10, 2 );
{{/gist}}