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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • E-mail this story to a friend!
  • IndianPad
  • LinkedIn
  • Live
  • MySpace
  • Print this article!
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

14 Responses to “Mullet code for WordPress”

  1. on 23 Jan 2006 at 11:51 amJonathan Boutelle's home on the net

    Mullet Blog Layout: Now in WordPress

    Kapil Mohan has implemented the Mullet blog layout in WordPress. And he’s also released the code for how to do it. This is something that people have been asking me for for months now, but that I’ve been too (busy?…

  2. on 23 Jan 2006 at 1:37 pmJesper Rønn-Jensen

    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

  3. […] Kapil Mohan in the post “Mullet” (and here is his code for WordPress) […]

  4. on 28 Mar 2006 at 11:50 pmHemanshu

    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?

  5. […] I definitely see the benefit in the “mullet”, and hope to adapt it to my blog pretty soon. I will post an entry on why it makes sense to me, and how I did it (will definitely include an adapted version of mullet code by Kapil Mohan). […]

  6. on 29 Mar 2006 at 9:25 amKapil

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

  7. […] Mullet for wordpress mullet, plugin, wordpress I hacked together a small function which runs the mullet on my front page. This is different than Kapil Mohan’s implementation in that the number (or how far back) to make the mullet is an argument to the function, thus you can control how many links to put in your mullet. […]

  8. on 25 May 2006 at 12:10 pmLarry Page

    Google is the best search engine.

  9. […] Thanks to Jonathan Boutelle for the original idea, Kapil Mohan for the mullet code, and Gopalarathnam for the long-tail archive code. […]

  10. on 17 Aug 2006 at 11:32 amJonathan Boutelle's home on the net

    New mullet in town at topofthemountains.net…

    Ben Crowder has implemented the mullet on his blog. Looks like he used Kapil Mohan’s wordpress mullet layout, and Gopal Arathanam’s long tail archive template. Makes me with I used wordpres for my blog! Nice job, the mullet looks great…….

  11. on 20 Sep 2006 at 3:54 pmhair removal

    hi,
    thanks for sharing this code it’s very useful while working on some important concepts

  12. on 20 Sep 2006 at 6:23 pmhair removal

    hi,
    thanku for giving the mullet code for wordpress.

  13. on 02 Nov 2008 at 7:35 amascecique

    Test message
    Sorry me noob…

  14. on 06 Nov 2008 at 4:23 amJean

    cool you saytik! Write more!

Trackback URI | Subscribe to the comments through RSS Feed

Leave a Reply