@esmi,
So I have another problem. How do I structure (keyword) the loop so that the first post looks different than the rest.
Like I said earlier, I found some code that could help me add class(es) to the first post, but I don’t know how to get it the way that I want.
I was thinking about something like this, but I think I run into issues of how things look on the pages of posts AFTER the first page of posts:
<?php // Beginning of the loop ?>
<?php if ( $paged < 2 ) { ?>
<?php
$latestPost = new WP_Query();
$latestPost->query('posts_per_page=1');
while ($latestPost->have_posts()) : $latestPost->the_post(); ?>
<div id="red-news"></div>
<div id="left">
<div class="latest-post"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="date"><span class="month"><?php the_time('M') ?></span><span class="day"><?php the_time('j') ?></span><span class="year"><?php the_time('Y') ?></span></div>
<div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('latest'); ?></a></div>
<div class="entry"><?php the_excerpt(); ?><div class="read-more"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">read more ></a></div>
</div><div class="clear"></div><div class="clear"></div></div><!-- end LATEST POST --><?php endwhile; ?>
<?php
$latestPost = new WP_Query();
$latestPost->query('posts_per_page=2&offset=1' . '&paged=' . get_query_var('paged'));
while ($latestPost->have_posts()) : $latestPost->the_post(); ?>
<div class="post">
<div class="date"><span class="month"><?php the_time('M') ?></span><span class="day"><?php the_time('j') ?></span><span class="year"><?php the_time('Y') ?></span></div>
<div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a></div>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry"><?php the_excerpt(); ?>
<div class="read-more"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">(...)</a></div>
</div>
<div class="clear"></div>
</div><!-- end POST -->
<?php endwhile; ?>
<div id="pagination"><?php wp_pagenavi(); ?></div>
<?php //This is the dividing line - Above: First page of the blog / Below: All the other pages ?>
<?php } else { ?>
<?php
$latestPost = new WP_Query();
$latestPost->query('posts_per_page=3&offset=3' . '&paged=' . get_query_var('paged'));
while ($latestPost->have_posts()) : $latestPost->the_post(); ?>
<div class="post">
<div class="date"><span class="month"><?php the_time('M') ?></span><span class="day"><?php the_time('j') ?></span><span class="year"><?php the_time('Y') ?></span></div>
<div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a></div>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry"><?php the_excerpt(); ?>
<div class="read-more"><a href="#">(...)</a></div>
</div>
<div class="clear"></div>
</div><!-- end POST -->
<?php endwhile; ?>
<?php } ?>
<?php // end "if 1st and 2nd page code ?>
Again, this is the OLD code. The original purpose of starting this thread was to get the traditional loop going (which I did), but I still have all the posts looking the same. There’s gotta be an easy way to fix this. Any ideas?
Anything would be GREATLY appreciated.
-hoss