Advertisement
Guest User

Untitled

a guest
Mar 20th, 2012
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <!-- post timeline -->
  2. <style type="text/css">
  3. #timeline {
  4. padding: 4px;
  5. margin: 0;
  6. list-style: none;
  7. overflow: hidden;
  8. background: #eee;
  9. font-size: 12px;
  10. }
  11. #timeline li {
  12. float: left;
  13. margin: 0;
  14. padding: 0 5px;
  15. text-transform: uppercase;
  16. border: solid #333;
  17. border-width: 0 1px 0 0;
  18. }
  19. #timeline li a {
  20. display: block;
  21. }
  22. </style>
  23. <?php
  24. echo '<ul id="timeline">';
  25. echo '<li>Latest</li>';
  26. $prev_month = '';
  27. $prev_year = '';
  28. $args = array(
  29. 'posts_per_page' => 10,
  30. 'ignore_sticky_posts' => 1
  31. );
  32. $postsbymonth = new WP_Query($args);
  33. while($postsbymonth->have_posts()) {
  34. $postsbymonth->the_post();
  35. ?>
  36. <li><a href="<?php the_permalink(); ?>"><?php the_time('j'); ?></a></li>
  37. <?php
  38. if(get_the_time('F') != $prev_month || get_the_time('Y') != $prev_year && get_the_time('Y') == $prev_limit_year) {
  39. echo "<li>< ".get_the_time('M')."</li>\n";
  40. }
  41. $prev_month = get_the_time('F');
  42. $prev_year = get_the_time('Y');
  43.  
  44. }
  45. echo '</ul>';
  46. ?>
  47. <!-- end post timeline -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement