• Resolved sunnydar

    (@sunnydar)


    I have two different search methods on my site. My theme (enfold) has a built-in ajax search that’s pretty good). I also use the plugin, sabai directory, which has it’s own directory search. unfortunately, sabai directory doesn’t use custom taxonomies/post types in any normal way, so no search plugins can find any of the pages sabai directory creates.

    Is it possible, to grab the search keywords from the theme search and show results from both the theme search and the directory search on the same page?

    As a side note, I’ve tried using plugins like relevanssi and wpsearch to improve search, but they can’t find the sabai directory pages/listings either.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s probably possible with some custom coding. It’s too specialized to expect a standard search plugin to pickup unusual, specific data.

    If sabai directory saves listings as custom post types, including them in searches is just a matter of adding the types to the post_type query var when the appropriate search query goes through the ‘pre_get_posts’ action. Plugin API/Action Reference/pre get posts This is assuming the AJAX search still uses WP_Query. If not, you may need a custom AJAX handler.

    But you say sabai doesn’t use post types in the normal way. How does sabai save listings? If the data is not returned as post objects, the data will need to be parsed into temporary post objects so the results can be merged with the regular post search results. This too is possible, it’s just more coding work.

    Thread Starter sunnydar

    (@sunnydar)

    Unfortunately, I really don’t know how the post types/data is stored. I just know that all of the search plugins i contacted said they weren’t compatible. Unfortunately, I don’t know PHP and get by with just copying snippets from one template into another. Any idea where I can get someone to affordably fix the search? It’s for a non-profit, so funds are always an issue.

    Moderator bcworkz

    (@bcworkz)

    Try https://jobs.wordpress.net/ . If the data is saved as a custom post type (likely), and the AJAX search uses WP_Query, then the coding involved is fairly minimal. It could take less than 15 minutes if my assumptions are correct. But time to check my assumptions and do research if they prove to be wrong could start adding up.

    Thread Starter sunnydar

    (@sunnydar)

    OK Thank you for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Grab search terms from wordpress search’ is closed to new replies.