Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
if ( ! is_admin() && $query->is_main_query() && $query->is_search ) {
<?php
dd_filter('pre_get_posts', 'vmf_filter_search');
function vmf_filter_search($query) {
if ( $query->is_search ) {
$query->set( 'post_type', array('post', 'page', 'portfolio') );
};
return $query;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment