Title: Warning: Illegal string offset &#039;taxonomy&#039; error!
Last modified: August 22, 2016

---

# Warning: Illegal string offset 'taxonomy' error!

 *  [Mironomadic](https://wordpress.org/support/users/mironomadic/)
 * (@mironomadic)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/)
 * Hello,
 * I am getting this error:
 *  Warning: Illegal string offset ‘taxonomy’ in /home3/mironom/public_html/cameraspro.
   com.br/wp-content/plugins/polylang/frontend/frontend.php on line 88
 * Your help is greatly appreciated.
 * Thanks
 * [http://wordpress.org/plugins/polylang/](http://wordpress.org/plugins/polylang/)
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/page/2/?output_format=md)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597531)
 * Hi!
 * This should come from a theme or plugin conflict. Try switching to Twenty Twelve
   and de-activate all your plugins except Polylang. Then switch back to your theme
   and activate your plugins one by one untile your reproduce the conflict.
 *  [kaldimar](https://wordpress.org/support/users/kaldimar/)
 * (@kaldimar)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597571)
 * Hi Chouby, I’m getting the same exact error:
 * `Warning: Illegal string offset 'taxonomy' in /home/kaldimar/public_html/wp-content/
   plugins/polylang/frontend/frontend.php on line 88`
 * In my case it only goes away by disabling the _Cherry Plugin_. Sadly, this is
   required for the theme to work, so disabling it is not an option and at the same
   time we’re relying on _Polylang_ for internationalization. Please advise, thanks.
 *  [kaldimar](https://wordpress.org/support/users/kaldimar/)
 * (@kaldimar)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597572)
 * FWIW, in line 87 the foreach is looping through an array which, for my home page,
   has four items, three of them arrays in turn and one (the second) is a string“
   AND”, this string is the one causing the warning.
 * A type check before evaluating the taxonomy index against ‘post_format’ may solve
   this?
 *  Thread Starter [Mironomadic](https://wordpress.org/support/users/mironomadic/)
 * (@mironomadic)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597625)
 * Hi Chouby!
 * Thanks for the reply but the error appeared after updating to wordpress 4.1
 * There was no recent addition of plugins which produced the error, however, i 
   did deactivate all and was unable to reproduce the conflect.
 * Please advice, thanks.
 *  [alain-schlesser](https://wordpress.org/support/users/alain-schlesser/)
 * (@alain-schlesser)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597652)
 * Hi,
 * I’m having exactly the same problem here. It appeared after WordPress update 
   to 4.1.
 * I suppose it is due to the changes that were done to the taxonomy queries for
   4.1…
 *  [alain-schlesser](https://wordpress.org/support/users/alain-schlesser/)
 * (@alain-schlesser)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597653)
 * I made a temporary fix to my site like follows. (NB: this is not a correct fix,
   and something might still be broken. This only removes the warning that is being
   displayed on the site, until the plugin author can provide a real fix.)
 * Edit frontend/fronted.php and change the section:
 *     ```
       $has_tax = false;
       		if (isset($query->tax_query->queries))
       			foreach ($query->tax_query->queries as $tax)
       				if ('post_format' != $tax['taxonomy'])
       					$has_tax = true;
       ```
   
 * to the following:
 *     ```
       $has_tax = false;
       		if (isset($query->tax_query->queries))
       			foreach ($query->tax_query->queries as $tax)
       				if( is_array( $tax ) && array_key_exists( 'taxonomy', $tax ) ) {
       					if ('post_format' != $tax['taxonomy'])
       						$has_tax = true;
       				}
       ```
   
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597659)
 * Hi!
 * This is a minor warning which in my opinion hasn’t any side affect. So your proposed
   fix should work. If errors are displayed on screen, just set WP_DEBUG to false
   in wp-config.php.
 * Nevertheless, I would be happy to know more about plugins or themes at the origin
   of this conflict.
 * After some search, I found out that it may be related to the new possibility 
   to use nested tax queries in WP 4.1. But I would be very surprised that a plugin
   or theme does already use this new feature. Do all of you use the Cherry plugin?
   Or could you test if there is some other conflict source?
 *  [alain-schlesser](https://wordpress.org/support/users/alain-schlesser/)
 * (@alain-schlesser)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597669)
 * Hi,
 * This error comes from the new ‘relation’ query parameter that’s been introduced
   by WP 4.1.
 * Here’s an excerpt from the codex:
 *     ```
       Taxonomy Parameters
       Show posts associated with certain taxonomy.
   
       {tax} (string) - use taxonomy slug. Deprecated as of Version 3.1 in favor of 'tax_query'.
       tax_query (array) - use taxonomy parameters (available with Version 3.1).
          relation (string) - The logical relationship between each inner taxonomy array when there is more than one. Possible values are 'AND', 'OR'. Do not use with a single inner taxonomy array.
             taxonomy (string) - Taxonomy.
             field (string) - Select taxonomy term by ('term_id'(default), 'name' or 'slug')
             terms (int/string/array) - Taxonomy term(s).
             include_children (boolean) - Whether or not to include children for hierarchical taxonomies. Defaults to true.
             operator (string) - Operator to test. Possible values are 'IN'(default), 'NOT IN', 'AND'.
   
       Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays). This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy arrays.
       ```
   
 * So, any plugin or theme could use this functionality now. The Warning appears
   because the ‘relation’ parameter is not an array, it is a simple string.
 * I think that the plugin using this on my site is Views by onTheGo Systems.
 *  [urweb](https://wordpress.org/support/users/urweb/)
 * (@urweb)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597679)
 * I also have this error:
    Warning: Illegal string offset ‘taxonomy’ in /home/xxx/
   wp-content/plugins/polylang/frontend/frontend.php on line 88
 * I am using ‘Real Homes’ theme.
 * Will there be a fix to thus issue?
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597683)
 * The development version (1.6.2.3) introduces a quick fix
    [https://downloads.wordpress.org/plugin/polylang.zip](https://downloads.wordpress.org/plugin/polylang.zip)
 *  [Tom](https://wordpress.org/support/users/atomiktd/)
 * (@atomiktd)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597696)
 * [@alain](https://wordpress.org/support/users/alain/)
    Your fix works good. Thank
   you.
 * I had this issue after I moved whole site to another server.
    Both differ in 
   PHP version. Old one runs PHP 5.3.27 and new one 5.4.24. Maybe this is a source
   of problems? Recently I have a lot off new issues of this kind when upgrading
   PHP on my sites.
 * BTW Thank you Chuby for this great plugin 🙂
 *  [kaiyakai](https://wordpress.org/support/users/kaiyakai/)
 * (@kaiyakai)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597707)
 * Hi, I am using ‘Real Homes’ theme as well.
    I upload the the version (1.6.2.3)
   and English page is fine. But it still having problem “error: Warning: Illegal
   string offset ‘taxonomy’ in /home/xxx/wp-content/plugins/polylang/frontend/frontend.
   php on line 88 ” with my Chinese Page.
 * Please advice, thanks.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597708)
 * Hi!
 * Strange. Could you copy-paste the line 88 here?
 *  [kaiyakai](https://wordpress.org/support/users/kaiyakai/)
 * (@kaiyakai)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597709)
 * Thanks for reply, the code as below:
    // to avoid conflict beetwen taxonomies//
   FIXME generalize post format like taxonomies (untranslated but filtered) $has_tax
   = false; if (isset($query->tax_query->queries)) foreach ($query->tax_query->queries
   as $tax) if( is_array( $tax ) && array_key_exists( ‘taxonomy’, $tax ) ) { if (‘
   post_format’ != $tax[‘taxonomy’]) $has_tax = true; }
 *  [kaldimar](https://wordpress.org/support/users/kaldimar/)
 * (@kaldimar)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/#post-5597710)
 * [@alain](https://wordpress.org/support/users/alain/) you got it right, in 4.1
   + instead of _$query->tax\_query->queries_ being purely an array of arrays, it
   has one item of type string, in my case “AND”. Not a good design in my opinion.
   Type checking inside the foreach loop may be enough to prevent the notice being
   fired.
 * [@tom](https://wordpress.org/support/users/tom/) it shouldn’t be related to PHP
   versions but rather in your previous server the error reporting was set to _Off_
   and in the new one all notices are exposed. If your site is live I’d suggest 
   you to turn error reporting off for good measure.

Viewing 15 replies - 1 through 15 (of 28 total)

1 [2](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/page/2/?output_format=md)

The topic ‘Warning: Illegal string offset 'taxonomy' error!’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * 28 replies
 * 8 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/atomiktd/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/warning-illegal-string-offset-taxonomy-error/page/2/#post-5597726)
 * Status: not resolved