I have a custom post type "Team Members". Right now If I type a team members name, it is just showing me the title of all the pages that contain How can I make it to search the content and not just the title
For example:- Team Member is John and the content is "John is bla bla bla, John is bla bla.
Now if I type john in the search bar, it should display all the john and not just the title
<?php
if ( have_posts() ) : ?>
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/**
* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead.
*/
get_template_part( 'template-parts/content', 'search' );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif; ?>
The search content is setup as follows"-
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<?php if ( 'Artist' === get_post_type() ) : ?>
<div class="entry-meta">
<?php edigital_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<footer class="entry-footer">
<?php edigital_entry_footer(); ?>
</footer><!-- .entry-footer -->