Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've the following navigation: (example)

<ul id="mainNav">
    <li><a href="#" class="watishet">Wat is het</a></li>
    <li><a href="#" class="hoewerkthet">Hoe werkt het?</a></li>
    <li><a href="#" class="resultaten">Resultaten?</a></li>
    <li><a href="#" class="onconavigator">OncoNavigator?</a></li>
    <li><a href="#" class="ziekenhuizen">Ziekenhuizen?</a></li>
</ul>

Can I add custom classes to a anchor element inside Wp_list_pages? because the current wp_list_page doesn't use a class attribute inside a anchor element. I want to add a unique class to each anchor element. For final result, I want to make a tab based horizontal dropdown menu.

I looked for couple of WordPress dropdown menu plugins but there wasn't anything out there that fulfill my wishes.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use the Wordpress Menu system, which allows you to set custom classes (Make sure you open up "Screen Options" and check the "CSS Classes" check box to see the settings)

share|improve this answer
    
tnx mate but does the menu system add those classes to list or anchor? is it <li class="bla"> or <a class="bla"> Tnx –  Navid Aug 3 '11 at 8:42
    
It adds it to the li (<li class="bla">) - there is no easy way to add a class to the <a> tag, so I'd suggest using this option and modifying your CSS or JavaScript - whatever is using the a.class should be able to be slightly modified to use the li.class. –  GavinR Aug 3 '11 at 18:42
    
Aah oke tnx mate it already works. –  Navid Aug 4 '11 at 9:46

Your Answer

 
discard

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.