what theme are you using?
general:
you could try using a counter variable or the loop variable $wp_query->current_post to distinguish between the posts;
example:
<?php //start of the loop;
if(have_posts()): while( have_posts() ) : the_post();
if( $wp_query->current_post < 5 && !is_paged() ) the_post_thumbnail();
the_title();
if( $wp_query->current_post == 0 && !is_paged() ) the_excerpt();
//end of the loop;
endwhile; endif; ?>
I’m working with custom theme.
How can i implement this code into my design.
My code looks like this:
<div class="header">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?></h2>
<p><?php the_excerpt(); ?></p>
</div>
<div class="main">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?></h2>
</div>
<div class="footer">
<h2><?php the_title(); ?></h2>
</div>
<div class="nav">
<?php previous_posts_link('Previous') ?><?php next_posts_link('Next') ?><a href="<?php echo home_url(); ?>" class="selected">Home</a></div>
and it need to be limit number of every item.
header (1 post)
main (next 4 posts)
footer (next 10 posts) -> those are moving with navigation
I did search for something like this for few times and i couldn’t find anything workable.
<?php if( $wp_query->current_post == 0 && !is_paged() ) : ?>
<div class="header">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?></h2>
<p><?php the_excerpt(); ?></p>
</div>
<?php elseif( $wp_query->current_post < 5 && !is_paged() ) : ?>
<div class="main">
<?php the_post_thumbnail(); ?>
<h2><?php the_title(); ?></h2>
</div>
<?php else : ?>
<div class="footer">
<h2><?php the_title(); ?></h2>
</div>
<?php endif; ?>
the only restriction with the above is that it always shows 15 posts per page;
having a different number of posts just on the first page of the pagination would require a custom-made pagination which might be exceedingly complicated.