Relevanssi breaks get_posts ‘s’ param
-
Hi, I’m using Relevanssi as my main search engine and it’s awesome!
Sadly, it looks like it also breaks my other “search” (more like post filter).
I’m using get_posts to display post from particular post type (real example at the end of this post). To filter post by name I’m using ‘s’ param from wp_query/parse_query.Here is how I use it:
$search_term = $_GET['filter']; // get filter param from URL, it is working fine, I've checked $postsArgsArray = []; if(isset($_GET['filter'])) { $postsArgsArray = [ 'posts_per_page' => -1, 'post_type' => 'shops', 's' => $search_term, 'orderby' => 'title', 'order' => 'ASC', ]; } $shops = get_posts($shopsArgsArray); foreach($shops as $p) { setup_postdata($p); echo $p->post_title; }After disabling Relevanssi this code works perfectly fine, it also used to work few months back. I’d much appreciate your help / any suggestions on how I could fix this 🙂
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Relevanssi breaks get_posts ‘s’ param’ is closed to new replies.