PageRenderTime 53ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/archive.php

https://github.com/Boomfelled/alan
PHP | 61 lines | 28 code | 7 blank | 26 comment | 3 complexity | 951690808f05c0ed7bccf8eeaf422bc5 MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /**
  3. * The template for displaying Archive pages.
  4. *
  5. * Used to display archive-type pages if nothing more specific matches a query.
  6. * For example, puts together date-based pages if no date.php file exists.
  7. *
  8. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  9. *
  10. * @package WordPress
  11. * @subpackage Twenty_Ten
  12. * @since Twenty Ten 1.0
  13. */
  14. get_header(); ?>
  15. <div id="container">
  16. <div id="content" role="main">
  17. <?php
  18. /* Queue the first post, that way we know
  19. * what date we're dealing with (if that is the case).
  20. *
  21. * We reset this later so we can run the loop
  22. * properly with a call to rewind_posts().
  23. */
  24. if ( have_posts() )
  25. the_post();
  26. ?>
  27. <h1 class="page-title">
  28. <?php if ( is_day() ) : ?>
  29. <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
  30. <?php elseif ( is_month() ) : ?>
  31. <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'F Y' ) ); ?>
  32. <?php elseif ( is_year() ) : ?>
  33. <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'Y' ) ); ?>
  34. <?php else : ?>
  35. <?php _e( 'Blog Archives', 'twentyten' ); ?>
  36. <?php endif; ?>
  37. </h1>
  38. <?php
  39. /* Since we called the_post() above, we need to
  40. * rewind the loop back to the beginning that way
  41. * we can run the loop properly, in full.
  42. */
  43. rewind_posts();
  44. /* Run the loop for the archives page to output the posts.
  45. * If you want to overload this in a child theme then include a file
  46. * called loop-archive.php and that will be used instead.
  47. */
  48. get_template_part( 'loop', 'archive' );
  49. ?>
  50. </div><!-- #content -->
  51. </div><!-- #container -->
  52. </div><!-- close Primary -->
  53. <?php get_sidebar(); ?>
  54. <?php get_footer(); ?>