category error FOR EACH
-
if (!count($category_posts)) {
$cat_counts = $wpdb->get_results(” SELECT cat_ID,
COUNT($tablepost2cat.post_id) AS cat_count
FROM $tablecategories
INNER JOIN $tablepost2cat ON (cat_ID = category_id)
INNER JOIN $tableposts ON (ID = post_id)
WHERE post_status = ‘publish’ $exclusions
GROUP BY category_id”);
foreach ($cat_counts as $cat_count) {
if (1 != intval($hide_empty) || $cat_count > 0) {
$category_posts[“$cat_count->cat_ID”] = $cat_count->cat_count;
}
}
}
when displaying categories it errors out with this error
Warning: Invalid argument supplied for foreach() in /home2/kemical/public_html/wp-includes/template-functions-category.php on line 304
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘category error FOR EACH’ is closed to new replies.