PageRenderTime 86ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/archive.php

https://github.com/monfresh/cfawp2012
PHP | 66 lines | 29 code | 15 blank | 22 comment | 3 complexity | 71de23e06bab5a40347bd1d0d3b0517d MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
  1. <?php
  2. /**
  3. * The template for displaying Archive pages.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Ten
  7. * @since Twenty Ten 1.0
  8. */
  9. get_header(); ?>
  10. <div class="wrap clearfix" id="inner">
  11. <div id="maincontent">
  12. <?php
  13. /* Queue the first post, that way we know who
  14. * the author is when we try to get their name,
  15. * URL, description, avatar, etc.
  16. *
  17. * We reset this later so we can run the loop
  18. * properly with a call to rewind_posts().
  19. */
  20. if ( have_posts() )
  21. the_post();
  22. ?>
  23. <div class="ttl"><?php if ( is_day() ) : ?>
  24. <?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
  25. <?php elseif ( is_month() ) : ?>
  26. <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date('F Y') ); ?>
  27. <?php elseif ( is_year() ) : ?>
  28. <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date('Y') ); ?>
  29. <?php elseif ( is_tag() ) : ?>
  30. <?php printf( __( '%s Archives', 'twentyten' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?>
  31. <?php elseif ( is_category() ) : ?>
  32. <?php printf( __( '%s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?>
  33. <?php else : ?>
  34. <?php _e( 'Blog Archives', 'twentyten' ); ?>
  35. <?php endif; ?></div>
  36. <?php
  37. /* Since we called the_post() above, we need to
  38. * rewind the loop back to the beginning that way
  39. * we can run the loop properly, in full.
  40. */
  41. rewind_posts();
  42. /* Run the loop for the author archive page to output the authors posts
  43. * If you want to overload this in a child theme then include a file
  44. * called loop-author.php and that will be used instead.
  45. */
  46. get_template_part( 'loop' );
  47. ?>
  48. </div>
  49. <div class="right-col">
  50. <?php get_sidebar(); ?>
  51. <?php get_footer(); ?>