Is it possible to show sort page excerpt in search.php


Current I have my search just return the title of the page that has the result, is there a way to show an excerpt

This is what i have

<?php get_header(); ?>

<section class="page-wrap">
    <div class="container">
        <div class="col-lg-9 section-space--ptb_30">

            $args = array(
                            's' =>$s
                // The Query
            $the_query = new WP_Query( $args );
            if ( $the_query->have_posts() ) {
                    _e("<h2 style='padding-bottom:20px;'>Search Results for '".get_query_var('s')."'</h2>");
                    while ( $the_query->have_posts() ) {
                                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                    <h2 style='font-weight:bold;color:#000'>Nothing Found</h2>
                    <div class="alert alert-info">
                      <p>Sorry, but nothing matched your search criteria. Please try again with some different keywords.</p>
            <?php } ?>




<?php get_footer(); ?>

, Milly Roc 3 years 2020-07-16T15:11:15-05:00 0 Answers 49 views 0

Leave an answer