Hey, below is the blog mulletization code for WordPress powered weblogs. It’s damn easy. Have fun!
<?php
// to count posts inside WP loop
$postCount=0;
// number of full posts to display
$displayNumPosts = 5;
?>
<?php
// WP loop
if(have_posts()) : while (have_posts()) : the_post();
?>
<?php
if($postCount<$displayNumPosts) {
?>
<!-- TEMPLATE CODE TO SHOW FULL POST -->
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
<div class="content">
<?php the_content(); ?>
</div>
<?php } else { ?>
<!-- TEMPLATE CODE TO SHOW MULLETED POST -->
<?php the_time('M j, y') ?>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
<?php } ?>
<?php
// increment $postCount
$postCount++;
?>
<?php
// WP loop ends
endwhile; endif;
?>
Thanks for sharing this! We’ll implement it very soon on our blog. Any chance that you’ll wrap this up and make available as a WordPress plugin?
/Jesper
PS. Jonathan Boutelle wrote about your effort here:
http://justaddwater.dk/2006/01/09/mullet-style-blog-layout-and-complete-archive-page/#comment-101
Hi Kapil,
I do want to use your code, but I had a question. I see no way as to where you are checking for a total number of posts? I mean how do you know in this loop when to stop?
Say I want a total of 5 + 30 posts in the mullet?
Hey Hemanshu,
Right now it is showing up all the posts. It uses a while loop to do so:
// WP loop
if(have_posts()) : while (have_posts()) : the_post();
Google is the best search engine.
hi,
thanks for sharing this code it’s very useful while working on some important concepts
hi,
thanku for giving the mullet code for wordpress.
Test message
Sorry me noob…
cool you saytik! Write more!