archive.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * The template for displaying archive pages.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Sakurairo
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php
  13. if (have_posts()) : ?>
  14. <?php if (!iro_opt('patternimg') || !z_taxonomy_image_url()) { ?>
  15. <header class="page-header">
  16. <h1 class="cat-title"><?php single_cat_title('', true); ?></h1>
  17. <span class="cat-des">
  18. <?php
  19. if (category_description() != "") {
  20. echo "" . category_description();
  21. }
  22. ?>
  23. </span>
  24. </header><!-- .page-header -->
  25. <?php } // page-header
  26. /* if (iro_opt('image_category') && is_category(explode(',', iro_opt('image_category')))) {
  27. while (have_posts()) : the_post();
  28. get_template_part('tpl/content', 'thumb');
  29. endwhile;
  30. } else {
  31. while (have_posts()) : the_post();
  32. get_template_part('tpl/content', 'thumbcard');
  33. endwhile;
  34. } */
  35. // TODO: 'image_category'功能待实现
  36. while (have_posts()) : the_post();
  37. get_template_part('tpl/content', 'thumbcard');
  38. endwhile; ?>
  39. <div class="clearer"></div>
  40. <?php else :
  41. get_template_part('tpl/content', 'none');
  42. endif; ?>
  43. </main><!-- #main -->
  44. <?php if (iro_opt('pagenav_style') == 'ajax') { ?>
  45. <div id="pagination" <?php if (iro_opt('image_category') && is_category(explode(',', iro_opt('image_category')))) echo 'class="pagination-archive"'; ?>><?php next_posts_link(__(' Previous', 'sakurairo')); ?></div>
  46. <div id="add_post"><span id="add_post_time" style="visibility: hidden;" title="<?php echo iro_opt('page_auto_load', ''); ?>"></span></div>
  47. <?php } else { ?>
  48. <nav class="navigator">
  49. <?php previous_posts_link('<i class="fa-solid fa-angle-left"></i>') ?><?php next_posts_link('<i class="fa-solid fa-angle-right"></i>') ?>
  50. </nav>
  51. <?php } ?>
  52. </div><!-- #primary -->
  53. <?php
  54. get_footer();