Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #209849

    Hi,

    I would like to change the search result page and add a preview of the text containing the search words on the results page.

    Basically I would like to have

    – Page Title
    Here the sentence in which the word appears.

    I would also like to replace the numbers by an icon.

    Do you know if this is something doable within Enfold?

    Thanks for your help

    #209870

    Hey oliviad!

    You can edit includes > loop-search.php, find this code:

    echo "<span class='search-result-counter {$counterclass}'>{$post_loop_count}</span>";

    Replace it with an image icon:

    echo "<span class='search-result-counter {$counterclass}'><img src='IMAGE URL HERE'></span>";

    What do you mean by “- Page Title Here the sentence in which the word appears.”?

    Cheers!
    Ismael

    #209965

    Hi, Thanks for your quick answer.

    I mean : in the search results page, instead of having the page’s excerpt, is it possible to have the excerpt where the word searched actually appears?

    Thanks,

    Olivia

    #209985

    Hey!

    I’m sorry for being dumb. Can you please explain it using a screenshot?

    Best regards,
    Ismael

    #209999

    Hi again,

    Sorry for not being clear ;)

    Here is a screenshot : http://goo.gl/lxcZG6

    Thanks

    #210218

    Hi!

    Excerpts are on by default but you need to add the excerpt text manually to all pages.

    Regards,
    Devin

    #210557

    Thanks you, is there a way to change that and get a automatically generated excerpt with the searched word? Thank you

    #210568

    Hi!

    You can edit includes > loop-search.php, find this code on line 88:

     
    $excerpt = trim(get_the_excerpt());
                    if(!empty($excerpt))
                    {
                        the_excerpt();
                    }
                    else
                    {
                        $excerpt = strip_shortcodes( get_the_content() );
                        $excerpt = apply_filters('the_excerpt', $excerpt);
                        $excerpt = str_replace(']]>', ']]>', $excerpt);
                        echo $excerpt;
                    }
    

    Replace it with:

    
    $excerpt = trim(the_excerpt());
                    if(!empty($excerpt))
                    {
                        the_excerpt();
                    }
                    else
                    {
                        $excerpt = strip_shortcodes( get_the_content() );
                        $excerpt = apply_filters('the_excerpt', $excerpt);
                        $excerpt = str_replace(']]>', ']]>', $excerpt);
                        echo $excerpt;
                    }
    

    Best regards,
    Ismael

    #210609

    Hi,

    Really sorry to bother you again but it does not make any difference. Any other idea?

    Thank you again

    #210648

    Hi!

    Please locate the same line of codes then replace it with:

    the_excerpt();

    It should automatically pull the excerpt. Remove browser cache then reload the page or test it on another browser.

    Best regards,
    Ismael

    #211520

    Hi again,

    Sorry but it does not change anything.

    I do not get any excerpt :(

    #211698

    Hey!

    Let me ask Dude about this. Please wait for his response. Please do the solutions above then remove browser cache or test it on another browser.

    Best regards,
    Ismael

    #211894

    Hey!


    @oliviad
    – this is not possible with the default wordpress search because it does not use a search index. You can install an advanced search plugin like SearchWP though.

    Cheers!
    Peter

    #213169

    Thank you very much. This plugin does exactly what I was looking for !
    A (very) last question : When there no result, I would like to remove the tabs with recent comments (as my website is not open to comment), and just let them browse the news. Is there an easy way to do so?

    #213221

    Hi!

    You can hide the tab with

    
    .tab.widget_tab_comments{display: none !important;}
    

    Cheers!
    Peter

    #213791

    Super ! thanks

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Customize Search Results Page’ is closed to new replies.