Go to
<a> Wordpress admin panel.
<b> Appearance.
<c> Editor.
<d> Open config.php file from 'Themes Functions' section.
<e> Append the following code in 'functions.php' file...
<f> Here last menu item class is 'last' and first menu item class is 'first'.
function wpb_first_and_last_menu_class($items)
{
$items[1]->classes[] = 'first';
$items[count($items)]->classes[] = 'last';
return $items;
}
add_filter('wp_nav_menu_objects', 'wpb_first_and_last_menu_class');
No comments:
Post a Comment