Last active
September 23, 2019 07:19
-
-
Save hluaces/db03d92ec758415c167ce585fd5805cf to your computer and use it in GitHub Desktop.
Filtro que añade a las búsquedas de WordPress tanto entradas como páginas
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
function filtro_mostrar_entradas_y_posts($query) { | |
if ($query->is_search) { | |
$query->set('post_type', ['post', 'page']); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','filtro_mostrar_entradas_y_posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment