I need urgent help figuring this out please – I’ve been working on a WordPress theme locally without problems, and now that I’ve uploaded it to the live server I’m getting this error:
Warning: Invalid argument supplied for foreach() in
/homepages/42/d357924500/htdocs/wp-includes/post.php
on line 1011
The corresponding code is related to the register_post_type
function:
foreach ( $args->taxonomies as $taxonomy ) {
register_taxonomy_for_object_type( $taxonomy, $post_type );
}
Could this be because of an error in my register_post_type
or register_taxonomy
code? The error shows both on the front-end and the admin side (also displays in widget option boxes when I try to update widgets – the changes don’t save).
I don’t really know much about PHP yet (still learning), but I know just enough to manage a few WordPress customisations. Both WordPress installations use version 3.1. Any help on this issue is very appreciated.
— UPDATE —
I tried creating a new term for my custom taxonomy of “type”, and I got this error in a red error box:
**Warning: Invalid argument supplied for foreach() in
/homepages/42/d357924500/htdocs/wp-includes/post.php
on line 1011Warning: Cannot modify header information – headers already sent by
(output started at
/homepages/42/d357924500/htdocs/wp-includes/post.php:1011)
in
/homepages/42/d357924500/htdocs/wp-includes/class-wp-ajax-response.php
on line 129Administration
administration0]]>Administration
administration0]]>**
The taxonomy term was obviously not saved.