How to query the WPSOLR results in my theme?
- 4 years, 1 month ago #16785
I would like to use some queries in my WordPress theme, for example to get some related posts.
Using the free version of Yith woocommerce ajax search widget I noticed that it works very well using the get_posts() function. If I use the same function somewhere only the title and description are search.
So what is the official way to create a query in my WP Theme to receive results from WPSOLR?
Is there a filter I can use?4 years, 1 month ago #16789
You say that there is no way to select simply 5 products based on a search query from WPSOLR.
Just be some PHP code? Or using WP functions?
Please explain why the get_posts() function works this way in the YITH ajax search plugin.
I tried it and the function can search on custom field values which are only indexed by WPSOLR4 years, 1 month ago #16790
There is no official way, no.
It has been done in the plugin, but in very specific conditions.
You can read the YITH Ajax search add-on code if you want. But it remains internal code, and it can change in the future. Unless you use the predefined actions/filters that you can find also in the add-on code.
- This reply was modified 4 years, 1 month ago by wpsolr.
You must be logged in to reply to this topic.