Is it possible to show 1 post on category main page and then the rest on p2?
-
Hi,
I’m new to WP and PHP, but have managed to cobble together something that’s almost doing what I want: I have a “Travels” Category and I would like to show the most recent Post on /travels/ and then show excerpts from all the Travels posts on /travels/page/2.
Right now, I have this before the Loop (in my category-7.php file which is the template for this Category):
$posts = query_posts($query_string . '&orderby=date&order=des&posts_per_page=-1');
Then I start the loop and then have this:
<!--Intro section for just 1st page of each category--> <?php if ( $paged < 2 ) { ?> Intro text and hand-picked posts to highlight
Followed by this:
<?php } else { ?> <!--Once you get past the first page, you get the list of all posts--> <ul class="posts"> <?php while (have_posts()) : the_post(); ?> <li> <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <?php the_excerpt() ?> <cite>Excerpt from “<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>”</cite> </li> <?php endwhile; ?> </ul>
Is it possible to show just the most recent post (or two or four) on the main Category page, but still show all of the Travels posts on page 2 (or show 30 posts at a time, etc.) on subsequent pages within this Category?
Thanks,
Bill
- The topic ‘Is it possible to show 1 post on category main page and then the rest on p2?’ is closed to new replies.