Is it possible to seperate wordpress menu by different div?

Yes it is possible, please take a look at the code below it will give you the basic idea. You can change ul to div and add some logic to match your needs. $menu_name=”primary”; $menu = wp_get_nav_menu_object( $locations[ $menu_name ] ); $menu_items = wp_get_nav_menu_items($menu->term_id); $menu_list=”<ul id=”menu-” . $menu_name . ‘”>’; foreach ( (array) $menu_items as … Read more

Links in new menu don’t work

You have a script active that prevents normal behaviour of links if they have no target=”_blank” attribute on them. The original site has this attribute on the link to the blog, so that one works. The ‘new’ site doesn’t have it on the menu links, so those links are disabled. To fix this, go to … Read more

How to Add Class in

If you need to add different classes for the tag, consider using jQuery .addClass() for it or javascript solution if you don’t want to use jQuery. Your other options are to try and fit the parameters which wp_nav can use. $args (array) (Optional) Array of nav menu arguments. ‘menu’ (string) Desired menu. Accepts (matching in … Read more

Show navigation header menu by post and categery

This code will check to ensure that the theme_location is header. Also, menu is the parameter where the desired WordPress Nav menu is specified. menu_id is the HTML ID that is applied to the <ul> element which forms the menu. Docs on the arguments for wp_nav_menu() can be found here. add_filter( ‘wp_nav_menu_args’, ‘bb_wp_nav_menu_args’ ); function … Read more

Secondary Menu display Primary Menu

You’ve got the code close, but incorrect. It is a spelling issue. It should be: <?php wp_nav_menu(array(‘theme_location’=>’primary’)); ?> <?php wp_nav_menu(array(‘theme_location’=>’secondary’)); ?> Please note that in your array you are using the_location and not theme_location. I believe with your mistake the menu will default to the primary menu (though I haven’t confirmed this).

Add a data attribute to list item element in menu

try this code in your functions file. function add_class_to_nav_items($nav_items, $args) { if ( $args[‘theme_location’] == ‘MY_NAV_THEME_LOCATION’ ) { // IMPORTANT: replace MY_NAV_THEME_LOCATION with the location of your menu foreach ($nav_items as &$nav_item) { $nav_item->classes[] = ‘custon-class-name’; } } return $nav_items; } add_filter( ‘wp_nav_menu_objects’, ‘add_class_to_nav_items’, 11 );

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