Echo some output foreach of categories children
-
I have an array called $regions.
When I’m on a category page I want to output some custom links like this:if (is_category()) { $cat_id = get_query_var('cat'); $catlist = get_categories('child_of=' . $cat_id); if (get_category_children($catlist->cat_ID) != "") { foreach(get_the_category($cat_id) as $catlist) { $i=0; echo $regions[$i] . " href=\"index.php?cat=" . $category->cat_ID . "\" alt=\"" . $category->cat_name . "\">"; $i++; } } }
This doesn’t work, but I’m not really a programmer so I don’t see my mistake. Anyone?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Echo some output foreach of categories children’ is closed to new replies.