Mullet code for WordPress

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;
?>

Advertisements

14 comments

  1. Pingback: Jonathan Boutelle's home on the net

  2. Pingback: justaddwater.dk | Mullet Layout: A user-friendly front page

  3. 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?

  4. Pingback: hci@work » Blog Archive » “Long tail archiving” and the “mullet”

  5. 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();

  6. Pingback: oldbrownshoe.org » Blog Archive » Mullet for wordpress

  7. Pingback: Top of the Mountains » Blog Archive » Give me a mullet, please

  8. Pingback: Jonathan Boutelle's home on the net


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s