Style latest post
-
Hi all.
I want to style my latest post on the homepage ONLY.
All entries are in an entry-head div.
This is my code right now.
<?php if ($postclass = ($post == $posts[0])) { echo '<p class="topstory">TOP STORY</p>'; } ?><?php } ?> <?php if (is_paged()) : ?> <?php $postclass = ('entry-head'); ?> <?php else : ?> <?php if (is_home('')) { ?><?php $postclass = ($post == $posts[0]) ? 'entry-head firstpost' : 'entry-head'; ?><?php } ?> <?php endif; ?> <div class="<?php echo $postclass; ?>">
It all works except on archive pages the p class=”topstory”>TOP STORY</p> displays, like page 2, page 3 etc. How do I stop this?
Is this code I used, did I do it right? If not, could you suggest an alternative?
Thanks a lot.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Style latest post’ is closed to new replies.