Hi I would like to exclude from my menus all child categories from a particular parent. Parent category has ID 111. I do not want to enter all ID of all child categories, so I would somehow like to set exclude all child of 111. Can you maybe help me please? Thank you in advance! Edit: I think I might be in the right way. This is what I have so far: <?php echo " <ul id='nav'>"; $ex_catIdArr = get_categories('child_of=111'); $catIdArr = array(); foreach($ex_catIdArr as $ex_catIdArrObj) { $catIdArr[] = $ex_catIdArrObj->term_id; } $includeCats = implode(',',$catIdArr); wp_list_categories('orderby=order&title_li=&exclude='.$includeCats); ?> Code (markup): The only problem is, that get_categories('child_of=111') does not get me all childs... Code works if I set include=111, but it the excluded only 111 in the list.
I tried to find something for you, but my bad luch didn't got anything. I guess you will have to put all id's manually
$categories= get_categories('child_of=10'); works fine for me ? can u please check issue is in your lop
This is not happening inside loop. I managed to solve the problem. the code in my first post actually works! The problem was, that I was importing categories manually and somehow connection from wp to database was not "refreshed" or something. So all I had to do it add one category through wp-admin, then deleted it as I didn't need it, and code above worked...