Specific display on Homepage
-
Hi, I searched the forums and the Codex but I could find how to do what I want to do, although I think it is not very complicated but I’m not good with code…
So here is my problem: I have my homepage on index.php. I use the main loop to display the latest post with content and the following ones with excerpt only.
<?php $i=1; ?> <?php while(have_posts()) : the_post(); ?> <?php if ($i == 1) : ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Read: <?php the_title(); ?>"><?php the_title(); ?></a><br /> <?php the_content(); ?> <br /> <br /> <?php else : ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Read: <?php the_title(); ?>"><?php the_title(); ?></a><br /> <?php the_excerpt(); ?> <?php endif; ?> <?php $i++; ?> <?php endwhile; ?>I works fine but what I want is only show the latest post with content on the homepage, not on the following pages (I use PageNavi Plugin). I tried to place is_home function before and after the main Loop, but nothing works, I got plenty of syntax errors I don’t know why…
So for now, when I go on page 2 (/page/2/), the first post on the page displays the content and the following ones the excerpt, exactly like on my homepage. And that’s what I want to avoid.
Any idea? Thanks a lot for your help! π
The topic ‘Specific display on Homepage’ is closed to new replies.