开发者

Wordpress - Adding class to the href in the using wp_nav_menu

I was wondering if its possible to add a class for the current page to the href tag instead of the li tag that wordpress开发者_Python百科 uses by default.

By menu arguments are as follows:

<?php wp_nav_menu( array( 
    'theme_location'    => 'main-menu',
    'container'         => '',
    'menu_class'        => '',
    'menu_id'           => 'nav'
) ); ?>

Cheers,


why do you want to do this? you can access the A in css using something like this:

#nav li.current-menu-item a {
  text-decoration:underline;
}

what exactly do you want to achieve?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜