Category Child Of not functioning
-
I can’t seem to get the child_of parameter for the categories working
What I have is
Articles (ID = 4)
– Accomodation (ID =7)
– Food (ID = 6)
– Money (ID = 5)I want to bring back all child categories of ID 4.
$cats=array( 'child_of' => 4 ); $categories = get_categories($cats); if ($categories) { $numcategories = count($categories); $term = $categories[$i]; echo ' <div class="articles-post"> <div class="articles-posttitlebox"><a href="' . get_category_link( $term->term_id ) . '">' . $term->cat_name.'</a></div> <img src="/wp/wp-content/uploads/category-images-ii/'.$term->term_id.'.original.jpg"> </div>'; } }
For some reason, this only brings back the category food.
Has anyone got any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Category Child Of not functioning’ is closed to new replies.