Sub category not displaying properly
-
Hi all, hope someone can help – this should be easy for anyone who knows PHP – unfortunately I dont have a clue!
I have a two level menu with categories and sub categories. I want the sub categories to be displayed when the main category is active.
I adapted the following code from another source except it was set up for pages so I am not sure if it is correct. At present the correct sub categories display but won’t disappear when you move to another category.
By the way Category 4 is the category I want to display the sub categories from
<?php
$thiscategory = $wp_query->post;
if($thiscategory->post_parent!=0)
{
wswwpx_fold_category_list(“title_li=&child_of=”.$thiscategory->post_parent);
}
else {
wp_list_categories(“title_li=&child_of=4”);}
?>
- The topic ‘Sub category not displaying properly’ is closed to new replies.