-
▼
2011
(334)
-
▼
April
(25)
- How to Fix a Broken WordPress Database
- How to Directly Upload a Picture to Your Wordpress...
- How to Import Large Wordpress XML Files to WordPress
- How to Upload Files to WordPress With an FTP
- WordPress: How to Alternate Row Colors
- How to Create New Categories in WordPress
- How to Update the OpenHook WordPress Plugin
- How to Publish to WordPress From Gmail
- How to Stop a Missed Schedule on WordPress
- How Do I Enable RSS for My Wordpress Blog?
- How to Archive a WordPress Blog to HTML Static Files
- How to Change the Primary Domain in WordPress
- How to Hide the Sidebar Title in WordPress
- How to Make a WordPress Website
- How to Teach an Online Course using WordPress
- How to Change the Password in Your WordPress Blogs
- How to Reformat Pages in a WordPress Blog
- How to Set Anchor Text in WordPress
- How to customize Wordpress Easily
- How to Add a Lightbox Effect to WordPress
- How to Have Autostart Music Play When They Enter Y...
- How to Make a Facebook Connect for WordPress
- How to Have Two WordPress Posts on the Same Page
- How to Change the Title in a WordPress Template
- How to Update WordPress 3.0
-
▼
April
(25)
adsense
WordPress: How to Alternate Row Colors
1. Open the 'header.php' file of your WordPress theme and look for '
' between your
and
tags. Add this code above the wp_head() function:
If your theme includes a
tag referencing the jQuery library, remove the entire
tag. WordPress comes with jQuery already installed.
2. Find the
and
tags between your
tags. This set of
tags does not include the 'src' attribute because it contains code embedded into the 'header.php' file. If your theme does not have these tags, add them. Add this code between the
tags like this:
jQuery(document).ready(function() {jQuery('.alternate:even tr').addClass('alt');});
Every other
tag in a table with a class name of 'alternate' gets the 'alt' class name. You can switch 'even' to 'odd' if desired.
3. Open the 'style.css' file of your WordPress theme and add this CSS code:.alternate .alt {background: color;}Change 'color' to the name of a color or its hexadecimal value. This CSS code sets a background color to every tag with a class name of 'alt' if that tag is nested within another tag given a class name of 'alternate.'
6:49 AM | Filed Under | 0 Comments
Post a Comment