title: Is it possible to display only section heading on the search page instated of all content in wordpress?
body: <p>I am working on the WordPress search. I am using the below code to get the data on the search page.</p>
  <pre><code>$s=get_search_query();
  $args = array(
                  's' =&gt;$s
              );
          
   $query = new WP_Query( $args );
   if( $query-&gt;have_posts() ) { ?&gt;
      &lt;ul&gt;
   &lt;? while( $query-&gt;have_posts() ) { 
          $query-&gt;the_post(); 
         // print_r($query);
          
  ?&gt;
  &lt;li&gt;&lt;h2&gt;&lt;a href='&lt;?php echo the_permalink();?&gt;'&gt;&lt;?php echo the_title();?&gt;&lt;/a&gt;&lt;/h2&gt;&lt;/li&gt;
  &lt;?php } ?&gt;
      &lt;/ul&gt;
      &lt;?php
  
          };
  
  ?&gt;
  </code></pre>
  <p>The above code is working. I am getting the title on the page.</p>
  <p>Now, My concern is, Is it possible to get the specific content on the page?</p>
  <p>I mean If I use <code>post_content</code> then I am getting all the content of the page. Is it possible to display only section heading on the search page?</p>