[/php]

The first thing we did was enclose both sets of code in their own css classes, allowing the posts to appear in two columns, rather than crammed together. As you can see in line 1, we start with a opening div class tag calling for “cusleft”. The tag is closed on line 10, before an opening tag for div class “cusright” is opened for the next column of posts.

Let’s take a closer look at lines 2-9, which contain the php code for displaying posts.

[php]have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>

[/php]

The php code starts off by stating that you’re starting a new WordPress query, then goes in to ask for category name and showposts. In our case, the category name we wanted to pull articles on the left for was called “articles”. We wanted to pull only one post, so our showposts number was one. Let’s say you had a category called “reviews”, and you wanted to show the last 10 posts from that category. Your php code would look like this:

[php]have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>

[/php]

Notice that the category name has been changed to “reviews”, and the showposts number has been increased from 1 to 10. The function continues, this time saying to itself, do not repeat the post (which eliminates the post showing more than once.) The next part of code determines how the post will be displayed. Let’s say you wanted the title to link to the full post content, and you wanted to display the whole post content. The code would look like this:

[php]

[/php]

Notice how we changed “php the_excerpt to php the_content. By wrapping the code in a div, we tell it to output each post the same way. In this way, you can define style elements to be applied to each post being displayed.