Hi Michael,
Thanks for the snippet. My internet was being slow (due to a national network issue here in South Africa) and you actually replied BEFORE my page reloaded. :-o
I managed to hack this bit of code that works, but (it is still early here so my brain is fuzzy), I was wondering how I can make it a bit more flexible for other categories.
<?php
// in category template, test if queried category is child descendant of another category
if (is_category()) {
$parent = 13; //it would be great if this was a variable of the current parent category
$categories = get_categories('include='.get_query_var('cat'));
if ( $categories[0]->category_parent == $parent || is_category($parent)) {
wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=0&child_of='. $parent);
}
}
?>
At the moment it works if you are in Category 13 or one of it's child, but I have several other categories that need the same functionality. eg. How could I make this snippet work if are in say category 20 or one of its childs, and do the same thing?
Perhaps you could get_parent_category, then parse that into the $parent variable?
Would it be possible to assist with another amazing code snippet? Sorry if this seems trivial.