WP-ThePHPSolution.php

Send Snippet To: Save this snippet to Code Collector Pro -- view all ian.k's snippets
language: PHP
license: Other

Code for Snippet:

                
/*
I think it's pretty much clear, it changed first post into a different div style (you can use here what ever you want of course). I've used this in my Solemnity free WordPress theme and if you would like to see how it looks click here for demo page. The only thing i don't like about this way is that your main loop in this case has to be in seperate div, you know you can't have anything between featured post and rest of posts (for example sidebar etc...) like here on Stylized Web. So becarefull how you will code it into html first 
• http://stylizedweb.com/2008/04/15/solemnity-wp-theme/
• http://stylizedweb.com/wp-content/themes/solemnity/index.html
 
*/
 
<?php $i=1; ?>
 
<?php while (have_posts()) : the_post(); ?>      
 
<?php if ($i == 1) { ?>      
<div id="post-<?php the_ID(); ?>" class="featured">
      featured content
</div>
 
<?php } else { ?>   
<div id="post-<?php the_ID(); ?>">
      rest of content
</div>
 
<!-- post -->
<?php } ?>       
 
<?php $i++; ?>
<?php endwhile; ?>
 
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 283
Date Added: 2013-03-18 05:19:02
Last Modified: 2014-04-07 14:16:07

Web Analytics