-
Notifications
You must be signed in to change notification settings - Fork 2
/
archive.php
executable file
·43 lines (36 loc) · 1.17 KB
/
archive.php
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
<?php
/*
Template Name: Archives
*/
?>
<?php get_header(); ?>
<div id="content">
<?php
$debut = 0; //The first article to be displayed
?>
<?php while(have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<ul id="archives">
<div class="alignright search"><form role="search" method="get" id="searchform" action="http://excid3.com/blog/">
<div>
<input type="text" value="" name="s" id="s" placeholder="Search Terms">
<input type="submit" id="searchsubmit" value="Search">
</div>
</form></div>
<?php
$myposts = get_posts('numberposts=-1&offset=$debut');
$last_post_date = "";
foreach($myposts as $post) :
$post_date = mysql2date("Y", $post->post_date_gmt);
if ($last_post_date != $post_date) {
$last_post_date = $post_date;
?>
<li class="archive-year"><?php echo $last_post_date?></li>
<?php } ?>
<li><span class="archive-date"><?php the_time('M j') ?></span> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php endwhile; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>