• I need to add a class to a the navigation bar, I’m using this to list pages:

    <ul>
    <?php wp_list_pages('title_li='); ?>
    </ul>

    I need my menu to look like this:

    <div id="menu">
    	  <div id="navigation-block">
    		  <ul id="sliding-navigation">
                <li class="sliding-element">
                  <h3>Welcome to Our Divine Savior!</h3></li>
                    <li class="sliding-element"><a href="#">About Us</a></li>
                    <li class="sliding-element"><a href="#">Parish Staff</a></li>
                    <li class="sliding-element"><a href="#">Mass Schedule</a></li>
                    <li class="sliding-element"><a href="#">Ministries</a></li>
                    <li class="sliding-element"><a href="#">Upcoming Events</a></li>
              </ul>
        </div>
        </div>

    Any idea how I can add the class sliding-element to the list items? Thanks in advance for the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • atlanteavila,

    Because each line item generated by WordPRess is already classed by “page_item” why not change “sliding-element” to “page_item” instead?

    Thread Starter atlanteavila

    (@atlanteavila)

    @doc4 – Duh!! Thank you! Is there a way to replace the default class? If not no biggie, this works for now! Thank you!!!

    Thread Starter atlanteavila

    (@atlanteavila)

    @doc4 – Duh!! Thank you! Is there a way to replace the default class? If not no biggie, this works for now! Thank you!!!

    atlanteavila,

    I wouldn’t replace the default class since this will only cause trouble later when updating WordPress. Then you would need to change it each time an update occurred.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding a css class to list items in my navigation bar’ is closed to new replies.