If you do not want WordPress to customize the article type, you can use the following code to display it in the search results.
Exclude custom article types from search results
Add code to the current topic function template functions.php:
function zm_filter_search( $query ) { if ( ! $query->is_admin && $query->is_search ) { //Add the article type you want to display in the search results $query->set( 'post_type', array( 'post', 'page', 'book' ) ); } return $query; } add_filter( 'pre_get_posts', 'zm_filter_search' );
Book is a user-defined article type. You can delete a page if you do not want the page to be displayed in the search results.
Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!