Support » Plugins » [Plugin: Simple Taxonomies] Warning: Invalid argument supplied for foreach()

  • I have tried installing thus plugin on a couple of my sites, and I keep getting this error on the top of every post:

    Warning: Invalid argument supplied for foreach() in /home/content/p/r/o/projectshadow/html/cedorsett/wp-content/plugins/simple-taxonomies/simple-taxonomies.php on line 294

    Any idea how to fix it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have the same problem. Anyone know how to fix this? This thread is 2 months old without any reply from the developer.

    It might have been caused by a conflict with another plugin. You may try re-uploading the simple-taxonomies plugin and then deactivate and reactivate all other plugins in tandem.

    S.K

    I am getting the same error on the top of every post – I tried deactivating all plugins and then reactivating only simple-taxonomies but still get the same error. Line 294 reads:

    foreach ( $opt['taxonomies'] as $taxonomy ) {

    as part of this function:

    function yoast_simple_taxonomies_filter( $content, $type ) {
    	$opt  = get_option('yoast_simpletax');
    	$output = '';
    	foreach ( $opt['taxonomies'] as $taxonomy ) {
    		$filter = false;
    		if ( $type == 'content' && $taxonomy['filter'] ) {
    			$filter = true;
    		} else if ( $type == 'excerpt' && $taxonomy['filterexcerpt'] ) {
    			$filter = true;
    		}
    		if ( $filter ) {
    			$terms = get_the_term_list( $post->ID, $taxonomy['name'], $taxonomy['label'].': ', ', ', '' );
    			if ($terms)
    				$output .= "\t".'<span class="taxonomy-'.$taxonomy['name'].'">'.$terms."</span><br />\n";
    		}
    	}
    	if ($output != '') {
    		$content .= '<div id="yoast-taxonomy">'."\n".$output."\n".'</div>'."\n";
    	}
    	return $content;
    }

    Any suggestions how to fix this? Thanks!

    as a quick and dirty fix, I’ve put this:

    if (!$opt['taxonomies']) return $content;

    just before the foreach and the warning is now gone

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Simple Taxonomies] Warning: Invalid argument supplied for foreach()’ is closed to new replies.