PageRenderTime 70ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/archive.php

https://github.com/mohitkr05/project-ar2
PHP | 39 lines | 32 code | 7 blank | 0 comment | 4 complexity | 758003e0b1663879223226b5bda50a09 MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php get_header(); ?>
  2. <div id="content" class="section" role="main">
  3. <?php ar2_above_content() ?>
  4. <?php if ( have_posts() ) : ?>
  5. <?php $post = $posts[ 0 ]; // Hack. Set $post so that the_date() works. ?>
  6. <?php if ( is_category() ) : ?>
  7. <h1 class="archive-title"><?php printf( __( '%s Archive', 'ar2'), single_cat_title( '', false) ) ?></h1>
  8. <?php elseif ( is_tag() ) : ?>
  9. <h1 class="archive-title"><?php printf( __('%s Archive', 'ar2' ), single_tag_title( '', false) ) ?></h1>
  10. <?php elseif ( is_tax() ) : $term = $wp_query->get_queried_object(); ?>
  11. <h1 class="archive-title"><?php printf( __( '%s Archive', 'ar2' ), $term->name ) ?></h1>
  12. <?php elseif ( is_day() ) : ?>
  13. <h1 class="archive-title"><?php printf( __( 'Archive for %s', 'ar2' ), get_the_time( __('F jS, Y', 'ar2') ) ) ?></h1>
  14. <?php elseif ( is_month() ) : ?>
  15. <h1 class="archive-title"><?php printf( __( 'Archive for %s', 'ar2' ), get_the_time( __('F, Y', 'ar2') ) ) ?></h1>
  16. <?php elseif ( is_year() ) : ?>
  17. <h1 class="archive-title"><?php printf( __( 'Archive for %s', 'ar2' ), get_the_time( __('Y', 'ar2') ) ) ?></h1>
  18. <?php elseif ( is_author() ) : ?>
  19. <h1 class="archive-title"><?php _e( 'Author Archive', 'ar2' ) ?></h1>
  20. <?php else : ?>
  21. <h1 class="archive-title"><?php _e( 'Blog Archives', 'ar2' ) ?></h1>
  22. <?php endif; ?>
  23. <div id="archive-posts">
  24. <?php ar2_render_posts( null, array ( 'type' => ar2_get_theme_option( 'archive_display' ) ), true ) ?>
  25. </div><!-- #archive-posts -->
  26. <?php else : ?>
  27. <?php ar2_post_notfound() ?>
  28. <?php endif; ?>
  29. <?php ar2_below_content() ?>
  30. </div><!-- #content -->
  31. <?php get_sidebar(); ?>
  32. <?php get_footer(); ?>