Remove class in nav_menu_link_attibutes filter

Let us first look at this part: I don’t exactly understand what object $item is and this is probably the problem. When I call get_class() on $item I get WP_Post, but WP_Post does not have a classes property. So how is $item->classes returning an array of classes? Few notes regarding the structure of menus in … Read more

Admin menu structure

Reposting as an answer since that solution worked for you. Please accept it as your answer. Now that I think of it, why don’t you just make your header posts a custom post type? It seem like that would give header posts their own space and keep them out of the standard posts menu. It … Read more

Secondary navigation menu on one page

If you need this menu on one page only, let’s say About Us (slug: about-us), you can easily add a conditional like this in pages.php at the place where you want the menu to appear: if (is_page(‘about-us’)) { wp_nav_menu( array( ‘theme_location’ => ‘secondary-menu’, ‘menu_class’ => ‘secondary’, ‘fallback_cb’ => ” )); } Remember that if you … Read more

Make nav-menus.php available for editor

OK now i understand : There was something wrong due to previous manipulations. add_cap is modifying the database, so somehow i had written over other capabilities and it broke the wanted result. So i cleaned the role with the use of a few remove_cap, put my functions back and voilà !

Difference between walker class and basic php

If you are building a theme just for your own website you could easily achieve with some PHP loops what the – indeed, more difficult to understand – walker class achieves. After all, the class just walks through a tree-like structure and does nothing more. If you know exactly what you want your tree to … Read more