Created
November 9, 2017 21:16
-
-
Save kirasiris/035d2c87db2c471a2c1886999b6f149d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Funcion para buscador. El input de buscar buscara la keyword unicamente en los post | |
function search_filter( $query ) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', array( 'post ', 'portfolios' , 'videos' , 'clients' , 'snippets' ) ); | |
} | |
} | |
} | |
add_action( 'pre_get_posts','search_filter' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment