Reply To: Formating results output


Ernest Marcinko


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.

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)