Adding two submenus to a menu

Hope you’ll find this well , I’m adding the code below. This is one of the way of doing it, you can do things in other ways also. add_action(‘admin_menu’,’create_admin_menu’); function create_admin_menu() { add_menu_page ( ‘Page Title’, ‘Top level menu Title’, ‘manage_options’, ‘your_unique_slug’, ‘your_magic_function’ ); function your_magic_function() { include_once(‘first.php’); } add_submenu_page ( ‘your_unique_slug’, ”, ”, ‘manage_options’, … Read more

wp_nav_menu in 3.7 add name class nav navbar-nav

Edit In this case, it appears that the problem is that you’re not actually outputting a custom nav menu at all, but rather the menu fallback: wp_page_menu(). Notice that the classes for the list items are page-item rather than menu-item. That’s a sure giveaway that the output is being generated by wp_page_menu() rather than wp_nav_menu(). … Read more

Add item ONLY to the primairy navigation

i did find my answer here : http://www.wpbeginner.com/wp-themes/how-to-add-custom-items-to-specific-wordpress-menus/ add_filter( ‘wp_nav_menu_items’, ‘your_custom_menu_item’, 10, 2 ); function your_custom_menu_item ( $items, $args ) { if (is_single() && $args->theme_location == ‘primary’) { $items .= ‘<li>Show whatever</li>’; } return $items; }

Where these arguments are defined?

You should look on ow WordPress Plugin Api works. When you add a filter, the function that hook into that filter receive the argument from the function: apply_filters. This function pass at least one argument, but can pass more, and always aspect a value returned. So if you can write add_filter( ‘walker_nav_menu_start_el’, ‘description_in_nav_el’, 10, 4 … Read more

Add more levels to menu

Go to wp-content/themes/templatename/ and then in header.php go to his line ‘depth’ => apply_filters( ‘yiw_main_menu_depth’, 3), Just change the number and done!

Replace Menu Item with Logged in username

you can do it with jQuery, but you’ll need to find that menu item’s class or ID. Here’s an example: <?php global $display_name; get_currentuserinfo(); ?> <script> jQuery(document).ready(function($) { $(‘.your-class a’).text(‘<?php echo $display_name;?>’); }); </script>

How to output the menue structured for tabbed navigation?

What a pitty that nobody responded. I had a hard way checking the walker class first before I found out that it’ll be much easier with wp_get_nav_menu_items() This is what I came up with. Not perfect but it works (only two levels which is enought for my page). $menu_name=”primary”; if ( ( $locations = get_nav_menu_locations() … Read more

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