Word Pressspecific styles for navigation

Magic Submitter

Instant Linkbuilding Solutions

Get Instant Access

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:

Was this article helpful?

0 0
Building Better Backlinks

Building Better Backlinks

Building effective backlinks can be instrumental in improving search engine ranking for your website and increasing quality traffic. Learn from the Pros How to Build Effective Backlinks in Order to Successfully Generate a High Volume of Quality Visitors to Your Website. Having Links Placed on Important Websites can Even Increase the Traffic of a Popular Website by More than 500.

Get My Free Ebook


Post a comment