Skip to content

Instantly share code, notes, and snippets.

@axxe16 axxe16/function.php

Created Jan 29, 2020
What would you like to do?
rendo ricercabile CPT #wp #search #customize
//aggiungo custom post type su cui effettuare la ricerca
function ek_add_post_type_to_search( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
if ( $query->is_search() ) {
add_filter( 'pre_get_posts', 'ek_add_post_type_to_search' );
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.