• Hallo,

    This plugin is awesome. It would be perfect, if the accordion would be open, when someone looks for a specific search term and it is inside the accordion content. I’ve typed in something into the default search form of WordPress, which then presents the list of contents, the search term appears in. When i click on one of these results, that page or post opens. It would be nice, if accordions on that page containing the search term would also be open, so you won’t miss the search term inside while searching.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    I agree this would be useful, but unfortunately I don’t think this is possible. I not aware of any way of retrieving the search term from the previous search results page after you select a search result.

    Thread Starter teazmo

    (@teazmo)

    Hallo Phil,

    Just the other day i installed a plugin called Highlight Search Terms by RavanH which highlights not only the search term on the search results, but also on that particular page, if you click on a result. Maybe there is some way of retrieving the search term and then leave the accordion open, that includes the search term.

    Thanks

    • This reply was modified 4 years, 5 months ago by teazmo. Reason: Link to plugin
    Thread Starter teazmo

    (@teazmo)

    Hi Phil,

    I would like to know, if leaving the accordion open when searching for a search term is still an option and if the hint I gave you about how the search term plugin retrieves the search term even if I open the single page is helpful. Our customer really likes the plugin, but wants to integrate this functionality to their search. They would even like to pay for a premium version.

    Thanks

    Plugin Author philbuchanan

    (@philbuchanan)

    The way that plugin works is by hacking the URLs on the search results page to add their own custom query param (see ?hilite= in the url of the single page). I suppose that is a clever solution, however, given that solution, I would have to add a special case to support this specific plugin. It wouldn’t work universally across all plugins. I’m not keen on adding special cases to this plugin—I’d rather keep it clean and simple.

    That said, given that the Highlight Search Terms plugin adds a query parameter to the URL you could implement your own custom solution that merges the functionality of the two in the theme or a separate plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Open accordion if there is a search term inside’ is closed to new replies.