• Resolved 12karen

    (@12karen)


    This plugin works perfectly with my regular WordPress search box, but on my advanced search page, which uses the Search & Filter Pro plugin, I have been unable to get the search terms to highlight.

    I added class=”hentry” to the div’s that contain the search results in the results.php file, but it still doesn’t work. Can anyone help, please?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Rolf Allard van Hagen

    (@ravanh)

    Hi, this plugin was made to detect search terms used by the WordPress internal search function. It sounds like the Search & Filter Pro plugin does not hook into the WordPress internal search but is using its own routines, making it impossible to be detected by the Highlight Search Terms plugin…

    If you can share a link to your advanced search page, I might be able to tell if search terms are detected at all. If it does, I’ll be able to tell you what is needed to make the highlight show but if not, it’ll be impossible to use Highlight Search Terms for highlighting in combination with Search & Filter Pro.

    Thread Starter 12karen

    (@12karen)

    Hi, thanks for the reply! Here’s the advanced search page: https://www.wisconsinappeals.net/advanced-search/
    I really appreciate any help you can give me!

    Plugin Author Rolf Allard van Hagen

    (@ravanh)

    It looks like the plugin cannot detect the search terms and is incompatible with Search & Filter Pro. Sorry…

    Thread Starter 12karen

    (@12karen)

    Hmm…this is possibly a stupid question (since I only vaguely understand how the plugin works!) but in the URL of the search results page of a search for the term “termination” I see
    ?_sf_s=termination
    and in the URL of a regular search results page (which works with Highlight Search Terms) I see ?s=termination
    Is there not a way I could get the plugin to look for both s and _sf_s? Or maybe is there a way I could change the code for Search & Filter so that it presents the search terms with just s?

    Plugin Author Rolf Allard van Hagen

    (@ravanh)

    If you are not afraid of modifying the highlight plugin, then you could try adding these lines to hlst.php on line 154:

    
    elseif ( isset($_GET['_sf_s']) AND $search = $_GET['_sf_s'] ) )
    	self::$search_terms = self::split_search_terms( $search );
    
    Thread Starter 12karen

    (@12karen)

    I tried, but somehow that code crashed the whole site!

    Thread Starter 12karen

    (@12karen)

    Update: it works! There was an extra parenthesis and once I deleted it, the search terms are now highlighted! Thank you soooo much!

    Plugin Author Rolf Allard van Hagen

    (@ravanh)

    Ow, my bad. I did not test that code before pasting it here… Sorry.

    Great to hear you spotted the error and made it work! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Doesn’t work with Search & Filter plugin?’ is closed to new replies.