Description
I’ve searched everywhere in the web however there may be completely no reply for this and it is tremendous annoying since it’s a easy factor that appears unimaginable in WordPress. All I must do is lengthen the WordPress default posts search code to search out customized put up forms of which the meta worth from a particular key corresponds to the search enter key phrase. Nevertheless it doesn’t matter what hook I exploit or what methodology I exploit it is going to at all times have the search outcome web page present me that there aren’t any outcomes. If I exploit a operate like get_posts() with the array of issues I would like it does truly give me the fitting posts, once I strive a customized SQL question inside my Database program it really works aswell nonetheless if I place both choices in WordPress, it simply by no means works.
Expectation
The search outcome pages exhibiting the put up(s) which are discovered based mostly on the key phrase offered by the consumer. The search prolonged to have it match not simply the title or the content material but additionally the precise meta information (or meta information from it is youngster posts).
What I’ve tried
- pre_get_posts hook
- posts_pre_query hook
- posts_request hook
- posts_where hook
- posts_search hook
And neither work. Ofc once I var_dump the leads to any hook when executing my very own SQL it does present within the var_dump however the search outcomes web page stays on “No outcomes discovered.”
What it isn’t
It isn’t a cache downside. It isn’t the flawed question. It isn’t the theme as it doesn’t matter what them I exploit identical outcome on the search outcomes web page. It isn’t a plugin battle no errors are proven anyplace not even in debug.log.
Query
I merely wish to run my very own SQL question with normal WordPress features or use the WP_Query class allthough I moderately keep away from utilizing WP_Query class as I discover it very unreliable.