Change the class of wordpress menu

This will add class sub-menu-0, sub-menu-1 and so on depending upon their depth. //This will go in functions.php file class wpse61220_submenu_class extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat(“\t”, $depth); $output .= “\n$indent<ul class=\”sub-menu-“.$depth.”\”>\n”; } } // Usage – // wp_nav_menu( array(‘walker’ => new wpse61220_submenu_class() ) ); Reference – function wp_nav_menu()

Second tier sidebar navigation

For now I have decided to use a CSS solution. I realized with the code above I do actually have classes I can work with. For example if you had this navigation in a you could use something like this. nav.sidebar li li li { display: none; } nav.sidebar li li.current_page_item > ul > li, … Read more

Show posts of parent in edit.php

If you are using just using 4 posts, I think that schools would better be suited as taxonomy terms rather than a post type. Associate your Posts with the school tax term. I would then create custom templates for each of those terms. taxonomy-schools-cambridge.php taxonomy-schools-teeside.php taxonomy-schools-newcastle.php taxonomy-schools-sunderland.php Within those templates, use a WP_Query object to … Read more

How to insert date in topNav

wp_nav_menu has a $container parameter that can be used to set the type of container (div or nav) or to disable it. You could set the parameter to false and hardcode the wrapper div whilst including a date inside of it: <!– BEGIN HEADER-TOP –> <div class=”navigation-wrap”> <?php wp_nav_menu( array( ‘theme_location’ => ‘topNav’, ‘depth’ => … 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.