Make a CMS like main-menu and sub-menu
-
Hi community!
I’m building a CMS based on WP. One thing I can’t make happen is my menu… Probably it’s very simple, but I can’t figure it out.
Simply, I want a main-menu with categories and pages in one list. When a category is clicked, I want a new list to appear with the sub-menu in (sub-categories)
You can take a look at my demo; my demo
It’s almost there, but when the sub-menu-item “Office” is clicked, the whol?e sub-menu disappears!
As it is now, I’m using this code;
<div class="grid_10" id="topMenu"> <ul> <?php wp_list_categories('depth=1&sort_column=menu_order&title_li='); ?> </ul> <div class="clear"></div> </div><!--topMenu--> <div class="grid_10" id="subMenu"> <ul> <?php if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != "") { echo ""; echo ""; wp_list_categories('orderby=id&show_count=0&title_li= &use_desc_for_title=1&child_of='.$this_category->cat_ID); echo "";}} ?> </ul> <div class="clear"></div> </div><!--subMenu-->
I know the sub-menu disappears cause the code looks for the children of the sub-menu-item. But I can’t figure it out…
Any help is appriciated…
Arnii
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Make a CMS like main-menu and sub-menu’ is closed to new replies.