Hi (@marincastro),
You can easily do this by editing this page:
(Your-Domain.com)/wp-content/themes/agama-pro/framework/blog/list.php
——————————————–
TO HIGHLIGHT THE SEARCHED TERMS IN TITLE.
First open the list.php file above and look for the following code:
<?php the_title(); ?>
Now replace the above code with:
<?php echo $title; ?>
Make sure that you paste this line above the title code:
<?php $title = get_the_title(); $keys= explode(” “,$s); $title = preg_replace(‘/(‘.implode(‘|’, $keys) .’)/iu’, ‘<strong class=”search-excerpt”>\0‘, $title); ?>
——————————————–
——————————————–
ALSO HIGHLIGHT THE SEARCHED TERMS IN EXCERPT.
Look for the following code:
<?php the_excerpt(); ?>
Now replace the above code with:
<?php echo $excerpt; ?>
Make sure that you paste this line above the excerpt code:
<?php $excerpt = get_the_excerpt(); $keys= explode(” “,$s); $excerpt = preg_replace(‘/(‘.implode(‘|’, $keys) .’)/iu’, ‘<strong class=”search-excerpt”>\0‘, $excerpt); ?>
——————————————–
Now open your CSS file and add the styling for the class search-excerpt, and it will highlight the terms. Currently the code is making the search terms bold. You can try this simple CSS in your theme’s style sheet.
strong.search-excerpt {
background-color:yellow;
color:black;
}
That’s it. Enjoy! ??
Thanks for contacting.