Relevanssi Polylang Search All Langauges
-
Hello,
Been trying to get my site to query all posts/woocommerce products in 2 languages using polylang.I saw that Relevanssi has a options in settings to allow/limit the language results so was hopeful I found a solution!
Unfortunately my results are still only returning in current active language.
I’m running latest latest wp and plugin versions, using the X Theme. Have the following selected in settings:
Unchecked limit results to current language
indexed:
Polylang_mo
taxonomy
language
post_translations
term_language
term_translations
post
page
product
product_variation
x-portfoliotaxonomy
language
post_translations
term_language
term_translations
product_type
product_tagAny suggestions on how to fix? Appreciate your help. Thanks!
-
Polylang doesn’t actually care about the Relevanssi setting, and instead adds it’s own setting. You can override that.
add_filter('relevanssi_modify_wp_query', 'rlv_remove_polylang'); function rlv_remove_polylang($q) { $q->tax_query = ""; $q->set('taxonomy', null); $q->set('term', null); return $q; }
Add this to theme functions.php. This will wipe out the Polylang language restriction, and you will see results from all languages. This will also wipe out all other taxonomy restrictions, so if you need other taxonomy restrictions, you need something more refined.
Hi Mikko,
Thanks for fast reply!
I tried inserting your code into functions.php but it did not seem to change anything. Anything else I might try?Thank you.
Sorry, no idea. That code worked on my test installation for Polylang.
If you change the function to this, what do you get when you search?
add_filter('relevanssi_modify_wp_query', 'rlv_remove_polylang'); function rlv_remove_polylang($q) { var_dump($q); return $q; }
Can you show me the complete output from that?
Here is the output:
Searching Russian term while on English site:
object(WP_Query)#816 (51) { [“query”]=> array(1) { [“s”]=> string(12) “карпов” } [“query_vars”]=> &array(69) { [“s”]=> string(12) “карпов” [“error”]=> string(0) “” [“m”]=> string(0) “” [“p”]=> int(0) [“post_parent”]=> string(0) “” [“subpost”]=> string(0) “” [“subpost_id”]=> string(0) “” [“attachment”]=> string(0) “” [“attachment_id”]=> int(0) [“name”]=> string(0) “” [“static”]=> string(0) “” [“pagename”]=> string(0) “” [“page_id”]=> int(0) [“second”]=> string(0) “” [“minute”]=> string(0) “” [“hour”]=> string(0) “” [“day”]=> int(0) [“monthnum”]=> int(0) [“year”]=> int(0) [“w”]=> int(0) [“category_name”]=> string(0) “” [“tag”]=> string(0) “” [“cat”]=> string(0) “” [“tag_id”]=> string(0) “” [“author”]=> string(0) “” [“author_name”]=> string(0) “” [“feed”]=> string(0) “” [“tb”]=> string(0) “” [“paged”]=> int(0) [“comments_popup”]=> string(0) “” [“meta_key”]=> string(0) “” [“meta_value”]=> string(0) “” [“preview”]=> string(0) “” [“sentence”]=> string(0) “” [“title”]=> string(0) “” [“fields”]=> string(0) “” [“menu_order”]=> string(0) “” [“category__in”]=> array(0) { } [“category__not_in”]=> array(0) { } [“category__and”]=> array(0) { } [“post__in”]=> array(0) { } [“post__not_in”]=> array(0) { } [“post_name__in”]=> array(0) { } [“tag__in”]=> array(0) { } [“tag__not_in”]=> array(0) { } [“tag__and”]=> array(0) { } [“tag_slug__in”]=> array(0) { } [“tag_slug__and”]=> array(0) { } [“post_parent__in”]=> array(0) { } [“post_parent__not_in”]=> array(0) { } [“author__in”]=> array(0) { } [“author__not_in”]=> array(0) { } [“tax_query”]=> array(2) { [0]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } [1]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } } [“ignore_sticky_posts”]=> bool(false) [“suppress_filters”]=> bool(false) [“cache_results”]=> bool(true) [“update_post_term_cache”]=> bool(true) [“update_post_meta_cache”]=> bool(true) [“post_type”]=> string(3) “any” [“posts_per_page”]=> int(500) [“nopaging”]=> bool(false) [“comments_per_page”]=> string(2) “50” [“no_found_rows”]=> bool(false) [“search_terms_count”]=> int(1) [“search_terms”]=> array(1) { [0]=> string(12) “карпов” } [“search_orderby_title”]=> array(1) { [0]=> string(41) “wp_posts.post_title LIKE ‘%карпов%'” } [“taxonomy”]=> string(8) “language” [“term_id”]=> int(32) [“order”]=> string(4) “DESC” } [“tax_query”]=> object(WP_Tax_Query)#578 (6) { [“queries”]=> array(2) { [0]=> array(5) { [“taxonomy”]=> string(8) “language” [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” [“operator”]=> string(2) “IN” [“include_children”]=> bool(true) } [1]=> array(5) { [“taxonomy”]=> string(8) “language” [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” [“operator”]=> string(2) “IN” [“include_children”]=> bool(true) } } [“relation”]=> string(3) “AND” [“table_aliases”:protected]=> array(2) { [0]=> string(21) “wp_term_relationships” [1]=> string(3) “tt1” } [“queried_terms”]=> array(1) { [“language”]=> array(2) { [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” } } [“primary_table”]=> string(8) “wp_posts” [“primary_id_column”]=> string(2) “ID” } [“meta_query”]=> object(WP_Meta_Query)#577 (9) { [“queries”]=> array(0) { } [“relation”]=> NULL [“meta_table”]=> NULL [“meta_id_column”]=> NULL [“primary_table”]=> NULL [“primary_id_column”]=> NULL [“table_aliases”:protected]=> array(0) { } [“clauses”:protected]=> array(0) { } [“has_or_relation”:protected]=> bool(false) } [“date_query”]=> bool(false) [“request”]=> string(32) “SELECT * FROM wp_posts WHERE 1=2” [“posts”]=> array(0) { } [“post_count”]=> int(0) [“current_post”]=> int(-1) [“in_the_loop”]=> bool(false) [“comment_count”]=> int(0) [“current_comment”]=> int(-1) [“found_posts”]=> int(0) [“max_num_pages”]=> int(0) [“max_num_comment_pages”]=> int(0) [“is_single”]=> bool(false) [“is_preview”]=> bool(false) [“is_page”]=> bool(false) [“is_archive”]=> bool(false) [“is_date”]=> bool(false) [“is_year”]=> bool(false) [“is_month”]=> bool(false) [“is_day”]=> bool(false) [“is_time”]=> bool(false) [“is_author”]=> bool(false) [“is_category”]=> bool(false) [“is_tag”]=> bool(false) [“is_tax”]=> bool(false) [“is_search”]=> bool(true) [“is_feed”]=> bool(false) [“is_comment_feed”]=> bool(false) [“is_trackback”]=> bool(false) [“is_home”]=> bool(false) [“is_404”]=> bool(false) [“is_embed”]=> bool(false) [“is_comments_popup”]=> bool(false) [“is_paged”]=> bool(false) [“is_admin”]=> bool(false) [“is_attachment”]=> bool(false) [“is_singular”]=> bool(false) [“is_robots”]=> bool(false) [“is_posts_page”]=> bool(false) [“is_post_type_archive”]=> bool(false) [“query_vars_hash”:”WP_Query”:private]=> string(32) “fc8043a290762a6172355eea6e8a9f33” [“query_vars_changed”:”WP_Query”:private]=> bool(true) [“thumbnails_cached”]=> bool(false) [“updated_term_meta_cache”]=> bool(false) [“updated_comment_meta_cache”]=> bool(false) [“stopwords”:”WP_Query”:private]=> array(29) { [0]=> string(5) “about” [1]=> string(2) “an” [2]=> string(3) “are” [3]=> string(2) “as” [4]=> string(2) “at” [5]=> string(2) “be” [6]=> string(2) “by” [7]=> string(3) “com” [8]=> string(3) “for” [9]=> string(4) “from” [10]=> string(3) “how” [11]=> string(2) “in” [12]=> string(2) “is” [13]=> string(2) “it” [14]=> string(2) “of” [15]=> string(2) “on” [16]=> string(2) “or” [17]=> string(4) “that” [18]=> string(3) “the” [19]=> string(4) “this” [20]=> string(2) “to” [21]=> string(3) “was” [22]=> string(4) “what” [23]=> string(4) “when” [24]=> string(5) “where” [25]=> string(3) “who” [26]=> string(4) “will” [27]=> string(4) “with” [28]=> string(3) “www” } [“compat_fields”:”WP_Query”:private]=> array(2) { [0]=> string(15) “query_vars_hash” [1]=> string(18) “query_vars_changed” } [“compat_methods”:”WP_Query”:private]=> array(2) { [0]=> string(16) “init_query_flags” [1]=> string(15) “parse_tax_query” } }
Searching English term on English site:
object(WP_Query)#816 (51) { [“query”]=> array(1) { [“s”]=> string(6) “karpov” } [“query_vars”]=> &array(69) { [“s”]=> string(6) “karpov” [“error”]=> string(0) “” [“m”]=> string(0) “” [“p”]=> int(0) [“post_parent”]=> string(0) “” [“subpost”]=> string(0) “” [“subpost_id”]=> string(0) “” [“attachment”]=> string(0) “” [“attachment_id”]=> int(0) [“name”]=> string(0) “” [“static”]=> string(0) “” [“pagename”]=> string(0) “” [“page_id”]=> int(0) [“second”]=> string(0) “” [“minute”]=> string(0) “” [“hour”]=> string(0) “” [“day”]=> int(0) [“monthnum”]=> int(0) [“year”]=> int(0) [“w”]=> int(0) [“category_name”]=> string(0) “” [“tag”]=> string(0) “” [“cat”]=> string(0) “” [“tag_id”]=> string(0) “” [“author”]=> string(0) “” [“author_name”]=> string(0) “” [“feed”]=> string(0) “” [“tb”]=> string(0) “” [“paged”]=> int(0) [“comments_popup”]=> string(0) “” [“meta_key”]=> string(0) “” [“meta_value”]=> string(0) “” [“preview”]=> string(0) “” [“sentence”]=> string(0) “” [“title”]=> string(0) “” [“fields”]=> string(0) “” [“menu_order”]=> string(0) “” [“category__in”]=> array(0) { } [“category__not_in”]=> array(0) { } [“category__and”]=> array(0) { } [“post__in”]=> array(0) { } [“post__not_in”]=> array(0) { } [“post_name__in”]=> array(0) { } [“tag__in”]=> array(0) { } [“tag__not_in”]=> array(0) { } [“tag__and”]=> array(0) { } [“tag_slug__in”]=> array(0) { } [“tag_slug__and”]=> array(0) { } [“post_parent__in”]=> array(0) { } [“post_parent__not_in”]=> array(0) { } [“author__in”]=> array(0) { } [“author__not_in”]=> array(0) { } [“tax_query”]=> array(2) { [0]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } [1]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } } [“ignore_sticky_posts”]=> bool(false) [“suppress_filters”]=> bool(false) [“cache_results”]=> bool(true) [“update_post_term_cache”]=> bool(true) [“update_post_meta_cache”]=> bool(true) [“post_type”]=> string(3) “any” [“posts_per_page”]=> int(500) [“nopaging”]=> bool(false) [“comments_per_page”]=> string(2) “50” [“no_found_rows”]=> bool(false) [“search_terms_count”]=> int(1) [“search_terms”]=> array(1) { [0]=> string(6) “karpov” } [“search_orderby_title”]=> array(1) { [0]=> string(35) “wp_posts.post_title LIKE ‘%karpov%'” } [“taxonomy”]=> string(8) “language” [“term_id”]=> int(32) [“order”]=> string(4) “DESC” } [“tax_query”]=> object(WP_Tax_Query)#578 (6) { [“queries”]=> array(2) { [0]=> array(5) { [“taxonomy”]=> string(8) “language” [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” [“operator”]=> string(2) “IN” [“include_children”]=> bool(true) } [1]=> array(5) { [“taxonomy”]=> string(8) “language” [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” [“operator”]=> string(2) “IN” [“include_children”]=> bool(true) } } [“relation”]=> string(3) “AND” [“table_aliases”:protected]=> array(2) { [0]=> string(21) “wp_term_relationships” [1]=> string(3) “tt1” } [“queried_terms”]=> array(1) { [“language”]=> array(2) { [“terms”]=> array(1) { [0]=> int(32) } [“field”]=> string(16) “term_taxonomy_id” } } [“primary_table”]=> string(8) “wp_posts” [“primary_id_column”]=> string(2) “ID” } [“meta_query”]=> object(WP_Meta_Query)#577 (9) { [“queries”]=> array(0) { } [“relation”]=> NULL [“meta_table”]=> NULL [“meta_id_column”]=> NULL [“primary_table”]=> NULL [“primary_id_column”]=> NULL [“table_aliases”:protected]=> array(0) { } [“clauses”:protected]=> array(0) { } [“has_or_relation”:protected]=> bool(false) } [“date_query”]=> bool(false) [“request”]=> string(32) “SELECT * FROM wp_posts WHERE 1=2” [“posts”]=> array(0) { } [“post_count”]=> int(0) [“current_post”]=> int(-1) [“in_the_loop”]=> bool(false) [“comment_count”]=> int(0) [“current_comment”]=> int(-1) [“found_posts”]=> int(0) [“max_num_pages”]=> int(0) [“max_num_comment_pages”]=> int(0) [“is_single”]=> bool(false) [“is_preview”]=> bool(false) [“is_page”]=> bool(false) [“is_archive”]=> bool(false) [“is_date”]=> bool(false) [“is_year”]=> bool(false) [“is_month”]=> bool(false) [“is_day”]=> bool(false) [“is_time”]=> bool(false) [“is_author”]=> bool(false) [“is_category”]=> bool(false) [“is_tag”]=> bool(false) [“is_tax”]=> bool(false) [“is_search”]=> bool(true) [“is_feed”]=> bool(false) [“is_comment_feed”]=> bool(false) [“is_trackback”]=> bool(false) [“is_home”]=> bool(false) [“is_404”]=> bool(false) [“is_embed”]=> bool(false) [“is_comments_popup”]=> bool(false) [“is_paged”]=> bool(false) [“is_admin”]=> bool(false) [“is_attachment”]=> bool(false) [“is_singular”]=> bool(false) [“is_robots”]=> bool(false) [“is_posts_page”]=> bool(false) [“is_post_type_archive”]=> bool(false) [“query_vars_hash”:”WP_Query”:private]=> string(32) “0d8cc20d048cac5c29195c4e629aeecb” [“query_vars_changed”:”WP_Query”:private]=> bool(true) [“thumbnails_cached”]=> bool(false) [“updated_term_meta_cache”]=> bool(false) [“updated_comment_meta_cache”]=> bool(false) [“stopwords”:”WP_Query”:private]=> array(29) { [0]=> string(5) “about” [1]=> string(2) “an” [2]=> string(3) “are” [3]=> string(2) “as” [4]=> string(2) “at” [5]=> string(2) “be” [6]=> string(2) “by” [7]=> string(3) “com” [8]=> string(3) “for” [9]=> string(4) “from” [10]=> string(3) “how” [11]=> string(2) “in” [12]=> string(2) “is” [13]=> string(2) “it” [14]=> string(2) “of” [15]=> string(2) “on” [16]=> string(2) “or” [17]=> string(4) “that” [18]=> string(3) “the” [19]=> string(4) “this” [20]=> string(2) “to” [21]=> string(3) “was” [22]=> string(4) “what” [23]=> string(4) “when” [24]=> string(5) “where” [25]=> string(3) “who” [26]=> string(4) “will” [27]=> string(4) “with” [28]=> string(3) “www” } [“compat_fields”:”WP_Query”:private]=> array(2) { [0]=> string(15) “query_vars_hash” [1]=> string(18) “query_vars_changed” } [“compat_methods”:”WP_Query”:private]=> array(2) { [0]=> string(16) “init_query_flags” [1]=> string(15) “parse_tax_query” } }One more:
add_filter('relevanssi_modify_wp_query', 'rlv_remove_polylang'); function rlv_remove_polylang($q) { $q->tax_query = ""; $q->set('taxonomy', null); $q->set('term', null); var_dump($q); return $q; }
What does this print out? Looking at those earlier printouts, your site has the language taxonomy query settings that are causing the problem you have, and this code should definitely clear those out.
Thanks Mikko,
Tried the new code and still doesn’t search all languaged
Here’s what printed out:object(WP_Query)#812 (51) { [“query”]=> array(1) { [“s”]=> string(12) “карпов” } [“query_vars”]=> &array(70) { [“s”]=> string(12) “карпов” [“error”]=> string(0) “” [“m”]=> string(0) “” [“p”]=> int(0) [“post_parent”]=> string(0) “” [“subpost”]=> string(0) “” [“subpost_id”]=> string(0) “” [“attachment”]=> string(0) “” [“attachment_id”]=> int(0) [“name”]=> string(0) “” [“static”]=> string(0) “” [“pagename”]=> string(0) “” [“page_id”]=> int(0) [“second”]=> string(0) “” [“minute”]=> string(0) “” [“hour”]=> string(0) “” [“day”]=> int(0) [“monthnum”]=> int(0) [“year”]=> int(0) [“w”]=> int(0) [“category_name”]=> string(0) “” [“tag”]=> string(0) “” [“cat”]=> string(0) “” [“tag_id”]=> string(0) “” [“author”]=> string(0) “” [“author_name”]=> string(0) “” [“feed”]=> string(0) “” [“tb”]=> string(0) “” [“paged”]=> int(0) [“comments_popup”]=> string(0) “” [“meta_key”]=> string(0) “” [“meta_value”]=> string(0) “” [“preview”]=> string(0) “” [“sentence”]=> string(0) “” [“title”]=> string(0) “” [“fields”]=> string(0) “” [“menu_order”]=> string(0) “” [“category__in”]=> array(0) { } [“category__not_in”]=> array(0) { } [“category__and”]=> array(0) { } [“post__in”]=> array(0) { } [“post__not_in”]=> array(0) { } [“post_name__in”]=> array(0) { } [“tag__in”]=> array(0) { } [“tag__not_in”]=> array(0) { } [“tag__and”]=> array(0) { } [“tag_slug__in”]=> array(0) { } [“tag_slug__and”]=> array(0) { } [“post_parent__in”]=> array(0) { } [“post_parent__not_in”]=> array(0) { } [“author__in”]=> array(0) { } [“author__not_in”]=> array(0) { } [“tax_query”]=> array(2) { [0]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } [1]=> array(4) { [“taxonomy”]=> string(8) “language” [“field”]=> string(16) “term_taxonomy_id” [“terms”]=> int(32) [“operator”]=> string(2) “IN” } } [“ignore_sticky_posts”]=> bool(false) [“suppress_filters”]=> bool(false) [“cache_results”]=> bool(true) [“update_post_term_cache”]=> bool(true) [“update_post_meta_cache”]=> bool(true) [“post_type”]=> string(3) “any” [“posts_per_page”]=> int(500) [“nopaging”]=> bool(false) [“comments_per_page”]=> string(2) “50” [“no_found_rows”]=> bool(false) [“search_terms_count”]=> int(1) [“search_terms”]=> array(1) { [0]=> string(12) “карпов” } [“search_orderby_title”]=> array(1) { [0]=> string(41) “wp_posts.post_title LIKE ‘%карпов%'” } [“taxonomy”]=> NULL [“term_id”]=> int(32) [“order”]=> string(4) “DESC” [“term”]=> NULL } [“tax_query”]=> string(0) “” [“meta_query”]=> object(WP_Meta_Query)#571 (9) { [“queries”]=> array(0) { } [“relation”]=> NULL [“meta_table”]=> NULL [“meta_id_column”]=> NULL [“primary_table”]=> NULL [“primary_id_column”]=> NULL [“table_aliases”:protected]=> array(0) { } [“clauses”:protected]=> array(0) { } [“has_or_relation”:protected]=> bool(false) } [“date_query”]=> bool(false) [“request”]=> string(32) “SELECT * FROM wp_posts WHERE 1=2” [“posts”]=> array(0) { } [“post_count”]=> int(0) [“current_post”]=> int(-1) [“in_the_loop”]=> bool(false) [“comment_count”]=> int(0) [“current_comment”]=> int(-1) [“found_posts”]=> int(0) [“max_num_pages”]=> int(0) [“max_num_comment_pages”]=> int(0) [“is_single”]=> bool(false) [“is_preview”]=> bool(false) [“is_page”]=> bool(false) [“is_archive”]=> bool(false) [“is_date”]=> bool(false) [“is_year”]=> bool(false) [“is_month”]=> bool(false) [“is_day”]=> bool(false) [“is_time”]=> bool(false) [“is_author”]=> bool(false) [“is_category”]=> bool(false) [“is_tag”]=> bool(false) [“is_tax”]=> bool(false) [“is_search”]=> bool(true) [“is_feed”]=> bool(false) [“is_comment_feed”]=> bool(false) [“is_trackback”]=> bool(false) [“is_home”]=> bool(false) [“is_404”]=> bool(false) [“is_embed”]=> bool(false) [“is_comments_popup”]=> bool(false) [“is_paged”]=> bool(false) [“is_admin”]=> bool(false) [“is_attachment”]=> bool(false) [“is_singular”]=> bool(false) [“is_robots”]=> bool(false) [“is_posts_page”]=> bool(false) [“is_post_type_archive”]=> bool(false) [“query_vars_hash”:”WP_Query”:private]=> string(32) “fc8043a290762a6172355eea6e8a9f33” [“query_vars_changed”:”WP_Query”:private]=> bool(true) [“thumbnails_cached”]=> bool(false) [“updated_term_meta_cache”]=> bool(false) [“updated_comment_meta_cache”]=> bool(false) [“stopwords”:”WP_Query”:private]=> array(29) { [0]=> string(5) “about” [1]=> string(2) “an” [2]=> string(3) “are” [3]=> string(2) “as” [4]=> string(2) “at” [5]=> string(2) “be” [6]=> string(2) “by” [7]=> string(3) “com” [8]=> string(3) “for” [9]=> string(4) “from” [10]=> string(3) “how” [11]=> string(2) “in” [12]=> string(2) “is” [13]=> string(2) “it” [14]=> string(2) “of” [15]=> string(2) “on” [16]=> string(2) “or” [17]=> string(4) “that” [18]=> string(3) “the” [19]=> string(4) “this” [20]=> string(2) “to” [21]=> string(3) “was” [22]=> string(4) “what” [23]=> string(4) “when” [24]=> string(5) “where” [25]=> string(3) “who” [26]=> string(4) “will” [27]=> string(4) “with” [28]=> string(3) “www” } [“compat_fields”:”WP_Query”:private]=> array(2) { [0]=> string(15) “query_vars_hash” [1]=> string(18) “query_vars_changed” } [“compat_methods”:”WP_Query”:private]=> array(2) { [0]=> string(16) “init_query_flags” [1]=> string(15) “parse_tax_query” } }
It sure isn’t removing the tax_query… Strange, the same code did work quite splendidly on my test site.
One more go, if this doesn’t help then I don’t know what will.
add_filter('relevanssi_modify_wp_query', 'rlv_remove_polylang'); function rlv_remove_polylang($q) { $q->tax_query = ""; $q->query_vars['tax_query'] = "" $q->set('taxonomy', null); $q->set('term', null); return $q; }
It worked! You’re the man! Kiitos paljon!!
Initially had a parse error which I fixed with ; to end of 4th line. I’m not at all a coder so felt good to fix something myself. ?
Search results now return in every language, but I still get the following error at the top of my screen:
Warning: Invalid argument supplied for foreach() in
…/wp-content/plugins/relevanssi/lib/ search.php on line 830looked up search.php:
328 if (isset($query->query_vars[‘tax_query’])) {
329 // This is user-created tax_query array as described in WP Codex
330 foreach ($query->query_vars[‘tax_query’] as $type => $item) {
331 if (is_string($type) && $type == ‘relation’) {
332 $tax_query_relation = $item;
333 }
334 else {
335 $tax_query[] = $item;
336 }Hope this is an easy fix. Thanks again.
Wow. Silly error. Just re-read my message and realized I made a mistake in listing line numbers for your search.php file.
The line numbers should have read:
828
829
830
…Change this line:
$q->query_vars['tax_query'] = "";
to
$q->query_vars['tax_query'] = null;
Does that help?
Yes! That solved the error.
Thank you for all your help!
- The topic ‘Relevanssi Polylang Search All Langauges’ is closed to new replies.