ID of parent Menu

Ended up using the following <script> $(function(){ var i =0; $(‘ul.sub-menu’).addClass (function(idx) { return “item-” + idx; }); }); </script> It adds a class of item-0, item-1, etc to each sub-menu it finds.

Change sub-menu css class

if you don’t want to use a custom menu walker, you can use the classes wp already puts out. If you add a class to the menu item you know will have a extra ul, you’ll have something like this <ul> <li class=”menu-item menu-item-1″>Item 1</li> <li class=”menu-item menu-item-2″>Item 2</li> <li class=”sub-1 menu-item menu-item-3″>Item 3 <ul … Read more

List child terms and posts in the current term

ok, i don’t know how this looks but i’ve got exactly what i wanted. <?php $term = get_queried_object(); $tax = ‘ntp_package_type’; $parents = $term->parent; $term_id = $term->term_id; if($parents == 0 && !is_single()){ wp_list_categories( array ( ‘taxonomy’ => ‘ntp_package_type’, ‘pad_counts’=> 0, ‘title_li’ => ”, ‘child_of’ => $term_id, ) ); } elseif ($parents > 0 && is_tax($tax, … Read more

Show custom menu in category and its posts

Well it looks like you are using theme that doesn’t have custom menu supporting code inside post and category templates. Since it’s working fine in page template you should go to Appearance -> Editor and open for editing page.php or index.php and look for wp_nav_menu() with all it’s arguments. Select and copy and insert it … Read more

Submenu opened problem

Within a WordPress framework, you can do this with a combination of body_class and CSS. body_class will echo classes into the <body> tag, including a page-parent class, which you can then use to control your elements. Without seeing your actual WordPress page, I can’t give you the necessary CSS.

Can’t remove menu items added by plugin

I’ll assume you’re calling it in your functions.php file? If that’s the case, likely the plugin is adding the menu item after you’re call is being called. Try placing it in the admin_init() hook, at the very end. if ( ! function_exists( ‘remove_wp_menu_items’ ) ) { function remove_wp_menu_items() { remove_submenu_page( ‘themes.php’, ‘theme-editor.php’ ); } } … Read more