Word Pressspecific styles for navigation

WordPress does now output several predefined CSS styles. There is a template tag that not only outputs the page links wrapped in an <li> tag, but adds the class attribute page_item to it along with several other class styles and possibilities depending on the state of the link within WordPress. For example, if the selected page link also happens to be the current page displayed, then an additional class called current_page_item is additionally applied.

If your WordPress theme was to take advantage of creating a robust menu for the page links, you could write individual styles for page_item and current_page_ item in order to have complete control over your page links menu. This would also ensure that your menu displays whichever page is currently active.

Multiple class styles assigned to the same XHTML object tag?

As you can see in the DOM Source of Selection graphic, you can have as many classes as you want assigned to an XHTML object tag. Simply separate the class names with a blank space and they'll affect your XHTML object in the order that you assign them. Keep in mind that the rules of cascading apply, so if your second CSS rule has properties in it that match the first, the first rule properties will be overwritten by the second. There are more suggestions for this trick in Chapter 9.

This means we simply change our Listamatic CSS from an id (#current) within an a:href item, to a class within our li item (current_page_item) as follows:

#navlist li.current_page_item a{ background: white; border-bottom: 1px solid white;

We now have a page layout that looks like the following:

We now have a page layout that looks like the following:

Link Wheels for Dummies

Link Wheels for Dummies

The only thing you need to start a link wheel is CONTENT Articles and the mentioned pages at your money site to link to. But like anything in IM, building a link wheel is not an exact science. Feel free to build the link wheel the way it suits you. Learn more within this guide by downloading it today.

Get My Free Ebook


Post a comment