Posted By

daipratt on 12/29/09


Tagged

wordpress group-posts


Versions (?)

Month bands for wordpress posts


 / Published in: PHP
 

URL: http://zoocha.com/blog/

Stick this inside the <?php> and you get the month group title shown only once for that date range. Sexy.

  1. <?php
  2. $date = the_date('F Y', '', '', FALSE);
  3. if ($date){
  4. if ($temp != $date){
  5. echo "<h2 class=\"month-band\">" . $date . "</h2>";
  6. }
  7. $temp = $date;
  8. }
  9. ?>

Report this snippet  

You need to login to post a comment.