In an try to make your WordPress search much more person pleasant, you possibly can spotlight the search phrases in the outcomes. We did this for one among our shoppers, so we thought it could be helpful for different customers. In this text we’ll present you how one can spotlight search phrases in the outcomes in WordPress.
First open your search.php and search for the following code:
<?php the_title(); ?>
Replace the above code with:
<?php echo $title; ?>
Make certain that you just paste this line above the title code:
<?php $title = get_the_title(); $keys= explode(" ",$s); $title = preg_replace('/('.implode('|', $keys) .')/iu', '<sturdy class="search-excerpt">