Mullet code for WordPress

Hey, below is the blog mulletization code for WordPress powered weblogs. It’s damn easy. Have fun!

  // to count posts inside WP loop
  // number of full posts to display
  $displayNumPosts = 5; 
  // WP loop
  if(have_posts()) : while (have_posts()) : the_post(); 
      if($postCount<$displayNumPosts) {     
        <a href="<?php the_permalink() ?>">
        <?php the_title(); ?>
        <div class="content">
        <?php the_content(); ?>
    <?php } else { ?>
        <?php the_time('M j, y') ?> 
        <a href="<?php the_permalink() ?>">
        <?php the_title(); ?>
    <?php } ?>    
      // increment $postCount
  // WP loop ends
  endwhile; endif;

14 thoughts on “Mullet code for WordPress

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

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

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s