id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 3179,warning in category template function,Denis-de-Bernardy,,"Warning: Invalid argument supplied for foreach() in /home/dolelm/public_html/testblog/wp-includes/template-functions-category.php on line 321 You can get this error when all categories are excluded using the available hook to drop categories. to fix, cast $categories on line 304 as an array, i.e.: {{{ $query = "" SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, category_count FROM $wpdb->categories WHERE cat_ID > 0 $exclusions ORDER BY $sort_column $sort_order""; $categories = (array) $wpdb->get_results($query); }}} D.",defect (bug),closed,normal,2.0.6,Template,2.0.4,major,fixed,has-patch,,