WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i wana add custom class to anchores in wp_nav_menu outputs.

default for example is :

<li id="menu-item" class="menu-item menu-item-type-custom">
<a href="http://example.com">example</a>

i wana this :

<li id="menu-item" class="menu-item menu-item-type-custom ">
<a href="http://example.com" class="class">example</a>
share|improve this question

You can add classes natively via interface in admin. Open Screen Options (top right of the screen) and check CSS Classes. I don't remember if class applies to link itself, but you can always target link inside container with CSS (.class a).

share|improve this answer
classes applies only in li tag. but using. – hosein Jul 29 '14 at 14:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.