-
AuthorPosts
-
January 15, 2014 at 3:43 am #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
January 15, 2014 at 6:37 am #209870Hey 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!
IsmaelJanuary 15, 2014 at 10:41 am #209965Hi, 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
January 15, 2014 at 11:01 am #209985Hey!
I’m sorry for being dumb. Can you please explain it using a screenshot?
Best regards,
IsmaelJanuary 15, 2014 at 11:44 am #209999January 15, 2014 at 7:29 pm #210218Hi!
Excerpts are on by default but you need to add the excerpt text manually to all pages.
Regards,
DevinJanuary 16, 2014 at 9:05 am #210557Thanks you, is there a way to change that and get a automatically generated excerpt with the searched word? Thank you
January 16, 2014 at 9:33 am #210568Hi!
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,
IsmaelJanuary 16, 2014 at 10:56 am #210609Hi,
Really sorry to bother you again but it does not make any difference. Any other idea?
Thank you again
January 16, 2014 at 12:11 pm #210648Hi!
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,
IsmaelJanuary 18, 2014 at 8:08 am #211520Hi again,
Sorry but it does not change anything.
I do not get any excerpt :(
January 18, 2014 at 9:56 pm #211698Hey!
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,
IsmaelJanuary 19, 2014 at 12:03 pm #211894January 22, 2014 at 5:07 am #213169Thank 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?January 22, 2014 at 10:24 am #213221Hi!
You can hide the tab with
.tab.widget_tab_comments{display: none !important;}
Cheers!
PeterJanuary 23, 2014 at 11:59 am #213791Super ! thanks
-
AuthorPosts
- The topic ‘Customize Search Results Page’ is closed to new replies.