How to determine if a category ID is a descendant of the top parent category

bymnimpaino

New Member
If the current category that the user is viewing is a descedant of a specific top category I want to show a specific list of categories:I know that I can get the current category ID with this code:\[code\]$cat = get_query_var('cat');\[/code\]But then how can I check that category ID is a descendant of a specific top parent category:\[code\] <?php if (.....) { ?> <?php wp_list_categories('orderby=id&show_count=0&use_desc_for_title=0&child_of='.$men->term_id); ?> <?php } ?> \[/code\]
 
Back
Top