public
Description: a wordpress theme for me
Homepage: http://blowery.org/
Clone URL: git://github.com/blowery/rococo.git
rococo / archives.php
100644 52 lines (42 sloc) 1.15 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
Template Name: Archives Page
*/
?>
<?php get_header(); ?>
 
<!-- html structure based on http://microformats.org/wiki/hatom -->
<div id="content" class="hfeed">
<?php if(have_posts()) : ?>
 
<?php while(have_posts()) : the_post(); ?>
 
<h2 class="entry-title"><?php the_title(); ?></h2>
<?php
global $post;
$myposts = get_posts('numberposts=1000000');
$year = '';
$mo = -1;
foreach($myposts as $post):
  $newmo = '';
$d = getdate(get_the_time('U'));
  if($d['mon'] != $mo) {
    $mo = $d['mon'];
    $newmo = ' newmonth';
  }
if($d['year'] != $year):
   $year = $d['year'];
?>
</ul>
<h3 class="year"><?php echo $year; ?></h3>
<ul class="archives">
<?php endif; ?>
<li class="<?php echo $newmo; ?>"><span class="datetime"><?php the_time('M d'); ?></span> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php endwhile; ?>
 
<?php else : ?>
 
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
 
<?php endif; ?>
 
</div>
 
<?php get_sidebar(); ?>
<?php get_footer(); ?>