Displaying the category children of ONE category
-
I have been trying to figure it out forever. I made it WAY more complicated then I needed to. SO if anyone wants to display the children of just ONE category, here is a way to do it. This will obviously be a list.
Maybe Ia€?ll write it as a plug-in when I have time. Like next year!
<ul>
<?php$get_children = $wpdb->get_results('SELECT * FROM dj_categories WHERE category_parent = "THE cat_ID of the PARENT that you want"');
foreach ($get_children as $child) {
echo '<li><a href="./?cat='.$child->cat_ID.'" title="View all posts filed under '.$child->cat_name.'">'.$child->cat_name.'</a></li>';
}?>
</ul>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Displaying the category children of ONE category’ is closed to new replies.