animeshtripathi
Member
Posted 1 year ago #
Hi, I'm editing my WordPress blog a bit. I have a featured post with a static image on the top, followed by a grid of other posts. Now, when I get the posts using PHP in index.php, it automatically fetches all posts, including the featured post. The featured post is the most recent post. I don't want the featured post to appear here. The URL is http://thinkrasta.com/home Here's the code I'm using to get the 'other' posts:
[Code moderated as per the Forum Rules. Please use the pastebin]
Thanks in advance. Could I use an 'offset' attribute for this? If so, how?
Animesh
animeshtripathi
Member
Posted 1 year ago #
Here's the code:
<?php while(have_posts()): the_post(); ?>
<?php if($count == 3): $count = 1; endif; if($count == 2): $class = 'last'; else: $class = ''; endif; ?>
<div class="item <?php echo $class; ?>">
general idea on how to avoid duplicate posts:
http://codex.wordpress.org/The_Loop#Multiple_Loops_in_Action
can you paste the full code of your template into a pastebin.com and post the link to it here?
animeshtripathi
Member
Posted 1 year ago #
Hi alchymth,
Thanks for your response. Here's the full code: http://pastebin.com/J52mueyU
You could see how the homepage looks at:
http://thinkrasta.com/home
animeshtripathi
Member
Posted 1 year ago #
*bump* ! Can someone help me out please?
animeshtripathi
Member
Posted 1 year ago #
So, I fixed it! I created a new query array for the other posts (the second loop being displayed)with offset=1, orderby= date, and it works!
here's the new code, if anyone needs to see it:
http://pastebin.com/cYK7GEb7