archives.php

Description: An optional Archives Index page which displays a list of links to archive pages.

This template includes the following templates:

Template Code

<?php get_header() ?>
	
	<div id="container">
		<div id="content">

<?php the_post() ?>

			<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
				<h2 class="entry-title"><?php the_title() ?></h2>
				<div class="entry-content">
<?php the_content(); ?>

					<ul id="archives-page" class="xoxo">
						<li id="category-archives" class="content-column">
							<h3><?php _e('Archives by Category', 'sandbox') ?></h3>
							<ul>
								<?php wp_list_cats('sort_column=name&optioncount=1&feed=RSS') ?> 
							</ul>
						</li>
						<li id="monthly-archives" class="content-column">
							<h3><?php _e('Archives by Month', 'sandbox') ?></h3>
							<ul>
								<?php wp_get_archives('type=monthly&show_post_count=1') ?>
							</ul>
						</li>
					</ul>
<?php edit_post_link(__('Edit', 'sandbox'),'<span class="edit-link">','</span>') ?>

				</div>
			</div><!-- .post -->

<?php if ( get_post_custom_values('comments') ) comments_template() // Add a key/value of "comments" to enable comments on pages! ?>

		</div><!-- #content -->
	</div><!-- #container -->

<?php get_sidebar() ?>

<?php get_footer() ?>

This template includes the following tags:

  • __() is a WordPress function used to mark a string for translation to another language. It is similar to _e(), except that __() returns the string while _e() echoes it.
  • _e() is a WordPress function used to mark a string for translation to another language. It is similar to __(), except that __() returns the string while _e() echoes it.
  • bloginfo() is a WordPress function that displays information about your blog. Using various parameters, the function can display the following strings:
    • Blog title;
    • Blog tagline;
    • Administrator's email address;
    • Document content-type;
    • Document charset;
    • WordPress version;
    • Blog URL;
    • Pingback URL;
    • URL of the RSS 0.92, RSS 1.0, RSS 2.0, or Atom feed;
    • URL of the comments feed;
    • URL of the directory in which WordPress is installed;
    • URL of the current template's directory;
    • URL of the current style.css file;
    • URL of the stylesheet directory (deprecated)
  • comments_template() is a WordPress include tag which includes the file comments.php.
  • edit_post_link() is a Wordpress tag which displays a link to edit the current post (assuming the user is logged in and has the appropriate permissions).
  • get_footer is a WordPress include tag which includes the file footer.php.
  • get_header is a WordPress include tag which includes the file header.php.
  • get_post_custom_values() is a WordPress PostMeta internal function used to get the list of values for a particular key on the current post. It should be within The Loop.
  • get_sidebar is a WordPress include tag which includes the file sidebar.php.
  • sandbox_post_class() is a Sandbox-specific class defined in the functions.php file. According to the Sandbox Readme, "It adds semantic classes to each post div element, relative to the actual post it contains."
  • the_content() is a Wordpress tag which displays the contents of the current post. This tag must be used within The Loop.
  • the_ID() is a WordPress tag which displays the numeric ID of the current post. It must be within The Loop.
  • the_post() is a WP_Query method: "Advance onto the next post, and set the global $post variable."
  • the_title() is a WordPress tag which displays or returns the title of the current post. This tag must be used within The Loop.
  • wp_get_archives() is a WordPress tag which displays a date-based archives list. It replaces the similar but deprecated get_archives(). This tag can be used anywhere within a template.
  • wp_list_cats() displays a list of Categories as links. Both wp_list_cats() and list_cats() have been deprecated; they should be replaced with wp_list_categories().

HTML Skeleton

[HEADER.PHP]

<div id="container">
	<div id="content">

		<h2 class="page-title">Monthly Archives: <span>[MONTH YEAR]</span></h2>

		<div id="nav-above" class="navigation">
			<div class="nav-previous">
				<span class="meta-nav">«</span> Older posts
			</div>  
			<div class="nav-next">
				<span class="meta-nav">»</span> Newer posts
			</div>
		</div>

		<div id="post-[#]" class="hentry p1 post publish author-[AUTHOR] category-[CATEGORY] tag-[TAG] y[YEAR] m[MONTH] d[DAY] h[HOUR]">
			<h3 class="entry-title">[POST TITLE]</h3>
			<div class="entry-date">
				<abbr class="published" title="[DATE]">[MONTH DAY, YEAR] – [TIME]</abbr>
			</div>
			<div class="entry-content">
				<p>[CONTENT]</p>
			</div>
			<div class="entry-meta">
				<span class="author vcard">By <a class="url fn n">[AUTHOR]</a></span>
				<span class="meta-sep">|</span>
				<span class="cat-links">Posted in <a rel="category tag">[CATEGORY]</a></span>
				<span class="meta-sep">|</span>
				<span class="tag-links">Tagged <a rel="tag">[TAG]</a></span>
				<span class="meta-sep">|</span>
				<span class="edit-link">[EDIT LINK]</span>
				<span class="meta-sep">|</span>
				<span class="comments-link">[COMMENTS LINK]</span> </div>
		</div>
		<!-- .post -->

		<div id="nav-below" class="navigation">
			<div class="nav-previous">
				<span class="meta-nav">«</span> Older posts
			</div>  
			<div class="nav-next">
				<span class="meta-nav">»</span> Newer posts
			</div>
		</div>

	</div>
	<!-- #content .hfeed -->
</div>
<!-- #container -->

[SIDEBAR.PHP]

[FOOTER.PHP]

Related CSS Styles

Resources

  • N/A