Monday, May 30, 2022
HomeWordPress Developmentwp question - search.php to go looking solely the put up title

wp question – search.php to go looking solely the put up title


I am making an attempt to rewrite my search.php to go looking just for the put up titles as a result of I’ve a ton of posts printed to my web site (round 400k), which slows down the search pace to about 20s per search.

<?php get_header();
$search_term = $_GET['s'];
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts = new WP_Query( array(
        's'     => "$search_term",
        'ep_integrate'   => true,
        'post_type'      => 'put up',
        'posts_per_page' => 21,           
        'orderby' => 'date',
         'order'   => 'DESC',
         'paged' => $paged,
    ) );
?>
<?php if ($posts->have_posts()) :
?>
<predominant>
<div class="container mt-5">
    <h4> Outcomes for" <?php the_search_query(); ?></h4>
    <hr type="margin-top: 0;">
    <div class="row clear full-img"> ...

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments