Created
August 15, 2012 12:17
-
-
Save IngmarBoddington/3359651 to your computer and use it in GitHub Desktop.
Generic Archive Page WordPress Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Template Name: Archive | |
*/ | |
get_header(); ?> | |
<div id="container"> | |
<div id="content" role="main"> | |
<h1 class="entry-title">Archive</h1> | |
<hr /><br /> | |
<h2>Archives by Category:</h2> | |
<ul> | |
<?php wp_list_categories( 'title_li=&show_count=1' ); ?> | |
</ul> | |
<h2>Archives by Tag:</h2> | |
<ul> | |
<?php | |
$tags = get_tags(); | |
foreach ( (array) $tags as $tag ) { | |
echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' (' . $tag->count . ') </a></li>'; | |
} | |
?> | |
</ul> | |
<h2>Last 30 Posts:</h2> | |
<ul> | |
<?php $archive_30 = get_posts('numberposts=30'); | |
foreach($archive_30 as $post) : ?> | |
<li><a href="<?php the_permalink(); ?>"><?php the_title();?></a></li> | |
<?php endforeach; ?> | |
</ul> | |
<h2>Archives by Month:</h2> | |
<ul> | |
<?php wp_get_archives('type=monthly&show_post_count=1'); ?> | |
</ul> | |
</div> | |
</div> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment