Tagged: SearchWP
-
AuthorPosts
-
March 24, 2016 at 2:51 pm #603089
Hi,
Thanks for helping me out.
Best regards
TobiasLink: Private
did this:So i should get the results from searchWP through the envold Ajax Search in header.
installed this:
so it should hightlight, but it does not
and did this:
You can take it one step further by utilizing Term Highlight to generate an excerpt from a number of potential sources (including Custom Fields) by replacing calls to the_excerpt() like so:
/* SearchWP Term Highlight offers an alternative to the_excerpt()
If you’re looking to generate any sort of excerpt based on one of the following:
– the actual excerpt
– the generated excerpt from the post content
– the post content itself
– string-based custom field values
this function is for you. It will try to find one of the above (in that order)
and output something with at least one search term in it (if possible)
*/
// echo the excerpt (designed to be used IN PLACE OF the_excerpt
if( function_exists( ‘searchwp_term_highlight_the_excerpt_global’ ) ) {
searchwp_term_highlight_the_excerpt_global();
}
// return the excerpt (designed to be used IN PLACE OF get_the_excerpt
if( function_exists( ‘searchwp_term_highlight_get_the_excerpt_global’ ) ) {
$excerpt = searchwp_term_highlight_get_the_excerpt_global();i talked a lot with the developer:
Answer: It looks like you are using Enfold’s live search functionality.
I’m not sure how to customize that results template but if you can
determine how to customize it you can highlight any string with$highlighter = new SearchWP_Term_Highlight();
$search_query = get_search_query();
$string = $highlighter->apply_highlight( $string, $search_query );March 28, 2016 at 7:26 pm #604017Hey Tobias-B-Conrad!
refer to this answer: https://kriesi.at/support/topic/how-to-edit-search-result-page/#post-223906
Basically I think you need to modify the search.php file in the theme files and the loop-search.php file in the includes folder of the theme files.
Cheers!
Andy -
AuthorPosts
- You must be logged in to reply to this topic.