Minor css-change based on topmenu – how?

My answer adds a class to the <body> element via the body_class filter. This is probably the easiest way to apply extra formatting to any element on the page. The added classes are wpse14430_products, wpse14430_services or wpse14430_contact (based on the slugs of the top pages in your example). Using wp_nav_menu() If you use wp_nav_menu() to … Read more

Is it possible to add a filter for the output of nav-menu items in admin?

These fields are created in Walker_Nav_Menu_Edit::start_el(). To change or to remove them, create a custom walker (example for another walker) that extends Walker_Nav_Menu_Edit and uses other or less fields. Then filter wp_edit_nav_menu_walker and return the class name of your walker. Pseudo-code: class Walker_Nav_Menu_Edit_Simple extends Walker_Nav_Menu_Edit { public function start_el( &$output, $item, $depth = 0, $args … Read more

Custom nav walker with different output depending on depth

Sounds like you want to check the $depth variable. A depth of 0 is a top level item, a depth of 1 is a child of a top level item, etc. So in keeping with your current code, you could factor out that logic this way: $format=”%1$s<a%2$s><div>%3$s%4$s%5$s</div></a>%6$s”; if( $depth > 0 ) $format=”%1$s<a%2$s><div class=”flintstone-nav”>%3$s%4$s%5$s</div></a>%6$s”; $item_output … Read more

Adding a class (arrows) to main menu links that have children?

There are two ways of doing this: Javascript. You could use JQuery to select the <li> that have <ul> children of class ‘sub-menu’, inserting content, or appending a CSS class which you then style. For example: $(‘.sub-menu’).parent().addClass(‘myclass’) PHP, a new walker function. Copy the code from wp-includes/nav-menu-template.php (until approx line 109) into your themes functions.php … Read more

How to implement separate sub-menus?

I can somehow understand what you are asking for but I think you should make this more clear. You already posted an example, but I think the main problem is: You connect some type of data to each other which is not known to wordpress. So as long as you don’t provide some hint how … Read more

Not able to get current menu ID

As far as I’ve seen a menu object does not have the ‘current’ property, does it? Not that I ever seen it, at least. So you can get close to what you’re asking by comparing the current post/page ID (get_the_ID()) with the items’ object_id property, when they match – boom! you got your currently selected … Read more

Put a wp_nav_menu inside another one

You could perhaps accomplish this via a custom walker, but I suggest you try a single menu containing submenus and display the submenus in other contexts by outputting just that branch of the main menu. see Display a portion/ branch of the menu tree using wp_nav_menu(), specifically this answer.

Creating new dynamic menu including BP links [closed]

Though I don’t have specific code to suggest, it seems like it would be possible to create something along the lines you mentioned by using a custom Nav Walker and generating buddypress-specific links with the $bp global (which you can learn more about here → http://codex.buddypress.org/developer/the-bp-global/). You could alter $output in the custom Nav Walker … Read more

Add section to custom menu panel

I have made a custom menu for the nav menu page to add post type archives just like posts/pages etc. I don’t think it’s possible to make it change the url on siteurl change. You could add the url as /slug/ instead of http://url.com/slug/, but that won’t work with WordPress in a folder. function add_post_types_nav_menu() … Read more

Customize the menu by adding items

To achieve this, you have to extend the Walker_Nav_Menu class. First, create a class that extends the Walker_Nav_Menu /** * Custom nav menu. * Code copy-pasted from /wp-includes/nav-menu-template.php * * @package WordPress * @since 3.0.0 * @uses Walker_Nav_Menu */ class User16975_Custom_Menu_Walker extends Walker_Nav_Menu { /** * @see Walker_Nav_Menu::start_lvl() * @since 3.0.0 * * @param string … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)