Custom Search Function in WordPress Returns No Results
Here’s the right code I made a mistake with s param function custom_search_query($query) { if (!is_admin() && $query->is_main_query() && $query->is_search()) { $search_query = get_search_query(); // Retrieve the search query $api_url=”https://api.adenwalla.in/api/search/data”; $args = array( ‘body’ => json_encode(array(‘query’ => $search_query)), ‘headers’ => array(‘Content-Type’ => ‘application/json’), ‘timeout’ => 60 ); $response = wp_remote_post($api_url, $args); $body = wp_remote_retrieve_body($response); $results … Read more