Alternating Your Post Background Colors

May 12, 2008

Here are the steps you need to take: Create a loop counter. Right before the Loop begins set a variable to zero. <?php $x=0; if (have_posts()) : ?> At this point I would want the Background Color to change, insert code to test for an even number post, and if this is true, add an inline CSS style for the background that would override the stylesheet. <?php if ($odd = $x%2){?> <div style=”background-color:#404040;padding:10px 0px 10px 10px;”> <?php }?> Then, where the background color should... [Read the full story]

Custom Textfield Background

May 8, 2008

The benefits to designing your own custom html text fields for use within your site can give you a completely personal look and feel that is totally your own. There are however, also some key disadvantages to this process. You can create any type of design, then use CSS to replace the actual text field background and have your own designed textfield. It’s easier then most would think. It’s the simple things that make or break your site. Now lets look at the code. HTML: <input type=”text” name=”This is the text... [Read the full story]