• Hello,
    I have
    menu1
    —submenu11
    —submenu12
    —submenu13
    menu2
    —submenu21
    —submenu22
    —submenu23
    let say I am on the pot submenu22 and i would like to display in my sidebar only : menu2
    —submenu21
    —submenu22
    —submenu23
    How could i do this?
    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Bernard Chabrol

    (@bernard-chabrol)

    I found this but it doesn’t works when i am on a post only on categories

    <?php
    $parentCatList = get_category_parents($cat,false,’,’);
    $parentCatListArray = split(“,”,$parentCatList);
    $topParentName = $parentCatListArray[0];
    $id = get_cat_id($topParentName);
    wp_list_cats(‘sort_column=id&optioncount=0&use_desc_for_title=0&child_of=’ . $id);
    ?>

    please help!

    [no bumping please]

Viewing 1 replies (of 1 total)
  • The topic ‘display a parent category with all its child’ is closed to new replies.