Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
facetwp is_home post type
/** makes sure the is_home query defaults to post rather than any post_type **/
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( is_home() && $is_main_query && empty( $query->get('post_type') ) ) {
$query->set( 'post_type', 'post' );
return $is_main_query;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.