This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Formating results output

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8311
    mensamensa
    Participant

    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 ?

    #8334
    mensamensa
    Participant

    Hi,

    Any update ? Is this possible ?

    #8346
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    It is possible with a custom filter I guess. Try adding this custom function into your active themes funtions.php file:

    [php]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;
    }[/php]

    This is case sensitive, so make sure the $text variable holds the exact text you want to replace.

    #8385
    mensamensa
    Participant

    Hi,

    Great.. Works. Thanks.

    #8390
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Great!

    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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.