How to change navwalker’s dropdown mark-up?

STEP 1 add a script to header like below ( it’s always better go for the enqueue method . i need some one to help me with properly adding the below script in WordPress way .jquery should run before the second script> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js” type=”text/javascript”></script> <script> $(document).ready(function () { $(‘.dropdown-menu a.dropdown-toggle’).on(‘click’, function(e) { if (!$(this).next().hasClass(‘show’)) … Read more

Add active class to wp_nav_menu

You wont need that PHP code to style links to the current page in your nav. WordPress adds a class (current-menu-item) by default on links to the current page. But WordPress does not style the link for you. That would be part of the theme. You can add a rule to the theme’s CSS ( … Read more

WordPress customizing a walker menu class

If you want change only CSS classes, you can use filters nav_menu_submenu_css_class (for <ul> element, codex) and nav_menu_css_class (for <li>, codex). Example of usage: add_filter(‘nav_menu_css_class’ , ‘special_menu_item_class’ , 20 , 4); function special_menu_item_class($classes, $item, $args, $depth) { // add or replace classes $classes[] = ‘rd-nav-item’; if ($args->has_children) { $classes[] = ‘rd-navbar–has-dropdown’; } return $classes; }

Add class to specific li item menu in function.php

To add CSS classes to menu item li, use filter nav_menu_css_class (codex). add_filter(‘nav_menu_css_class’ , ‘hideMenuItem’ , 15 , 4); function hideMenuItem($classes, $item, $args, $depth) { $commerce = get_field(‘ecommerce’, ‘option’); if ( !$commerce ) { $menu_items = array(566, 567, 363, 364 ); if ( in_array($item->ID, $menu_items) ) { $classes[] = ‘hidden’; } } else { $menu_items … Read more

Highlight inner post menu current item

I asked this question based on 2 facts: – The menu is created by WordPress. – The plugin; all it does is generate a shortcut to insert the menu inside the post. So the question is not Theme related, and not plugin related. It´s WordPress related. Nevertheless, I asked the Theme developer and the Plugin … Read more

Display_name in menu

You should first check if the user is logged in, doing is_user_logged_in(), if so you get the username. function give_profile_name(){ if ( is_user_logged_in() ) { $user=wp_get_current_user(); $name=$user->display_name; return $name; } else { return “”; } } You can also change your if to check if the shortcode is returning Untitled. if ( isset( $shortcode_tags[‘profile_name’] ) … Read more

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