How to add Class in using wp_nav_menu() in WordPress?

No need to create custom walker. Just use additional argument and set filter for nav_menu_css_class. For example: $args = array( ‘container’ => ”, ‘theme_location’=> ‘your-theme-loc’, ‘depth’ => 1, ‘fallback_cb’ => false, ‘add_li_class’ => ‘your-class-name1 your-class-name-2′ ); wp_nav_menu($args); Notice the new ‘add_li_class’ argument. And set the filter on functions.php function add_additional_class_on_li($classes, $item, $args) { if(isset($args->add_li_class)) { … Read more

The requested URL /about was not found on this server

If all above point not work. Then try this one. I tried it. It’s working for me. Go /etc/httpd/conf/httpd.conf. Change the AllowOverride None to AllowOverride All. Restart the apache server. UPDATE 2017 For new versions of apache the file is called apache2.conf So to access the file, type sudo nano /etc/apache2/apache2.conf and change the correspondent … Read more

How can I get the current page name in WordPress?

The WordPress global variable $pagename should be available for you. I have just tried with the same setup you specified. $pagename is defined in the file wp-includes/theme.php, inside the function get_page_template(), which is of course is called before your page theme files are parsed, so it is available at any point inside your templates for … Read more

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