Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Custom Post Types in die WordPress-Suche integrieren

Custom Post Types in die WordPress-Suche integrieren. Auf Zeile 2 site, plugin, theme und person durch die entsprechenden Custom Post Types ersetzen.

function ah_searchAll( $query ) {
 if ( $query->is_search ) { $query->set( 'post_type', array( 'site','plugin','theme','person' )); } // Custom Post Types noch anpassen
 return $query;
}
add_filter( 'the_search_query', 'ah_searchAll' );