Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Formating results output
This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko 7 years, 5 months ago.
- AuthorPosts
- April 7, 2016 at 8:37 pm #8311
Hi,
Reference : http://satviks.com
Search Restaurants : Use keyword “Mexican”Help required for
=============
title – Is there a way to format the title fields in the display. For eg in the search output (when you use “Mexican”), I need Promotions “10% Off” in red color.Is the above two items possible ?
April 9, 2016 at 9:52 pm #8334Hi,
Any update ? Is this possible ?
April 11, 2016 at 11:49 am #8346Hi!
It is possible with a custom filter I guess. Try adding this custom function into your active themes funtions.php file:
add_filter( 'asp_pagepost_results', 'asp_highlight_off_title', 1, 1 ); function asp_highlight_off_title( $pageposts ) { // Text to replace with red $text = "10% Off"; foreach ($pageposts as $k=>$v) { // Replace title with red font $pageposts[$k]->title = str_replace($text, "<span style='color: red;'>".$text."</span>", $pageposts[$k]->title); } return $pageposts; }
This is case sensitive, so make sure the $text variable holds the exact text you want to replace.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 17, 2016 at 6:45 am #8385Hi,
Great.. Works. Thanks.
April 18, 2016 at 11:04 am #8390Great!
If you like the plugin, feel free to rate it on your codecanyon downloads page, it’s greatly appreciated.
I will close this topic now and mark it as resolved. If you have any other issues, feel free to open another one.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.