index.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * The main template file.
  4. *
  5. * This is the most generic template file in a WordPress theme
  6. * and one of the two required files for a theme (the other being style.css).
  7. * It is used to display a page when nothing more specific matches a query.
  8. * E.g., it puts together the home page when no home.php file exists.
  9. *
  10. * @link https://codex.wordpress.org/Template_Hierarchy
  11. *
  12. * @package Akina
  13. */
  14. get_header();
  15. ?>
  16. <?php if (iro_opt('bulletin_board') == '1') {
  17. $text = iro_opt('bulletin_text');
  18. ?>
  19. <div class="notice" style="margin-top:60px">
  20. <?php if (iro_opt('bulletin_board_icon', 'true')) : ?>
  21. <div class="notice-icon"><?php _e('Notice','sakurairo') ?></div>
  22. <?php endif; ?>
  23. <?php if (strlen($text) > 142) { ?>
  24. <marquee align="middle" behavior="scroll" loop="-1" scrollamount="6" style="margin: 0 8px 0 20px; display: block;" onMouseOut="this.start()" onMouseOver="this.stop()">
  25. <div class="notice-content"><?php echo $text; ?></div>
  26. </marquee>
  27. <?php } else { ?>
  28. <div class="notice-content"><?php echo $text; ?></div>
  29. <?php } ?>
  30. </div>
  31. <?php } ?>
  32. <?php
  33. if (iro_opt('exhibition_area') == '1') {
  34. if (iro_opt('exhibition_area_style') == 'left_and_right') {
  35. get_template_part('layouts/feature_v2');
  36. } else {
  37. get_template_part('layouts/feature');
  38. }
  39. }
  40. ?>
  41. <div id="primary" class="content-area">
  42. <main id="main" class="site-main" role="main">
  43. <h1 class="main-title"> <i class="<?php echo iro_opt('post_area_icon', 'fa-regular fa-bookmark'); ?>" aria-hidden="true"></i> <br> <?php echo iro_opt('post_area_title', '文章'); ?> </h1>
  44. <?php
  45. if (have_posts()) :
  46. if (is_home() && !is_front_page()) : ?>
  47. <header>
  48. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  49. </header>
  50. <?php
  51. endif;
  52. /* Start the Loop */
  53. if (iro_opt('post_list_style') == 'akinastyle') {
  54. while (have_posts()) : the_post();
  55. get_template_part('tpl/content', get_post_format());
  56. endwhile;
  57. } else {
  58. get_template_part('tpl/content', 'thumb');
  59. }
  60. ?>
  61. <?php else : get_template_part('tpl/content', 'none');
  62. endif; ?>
  63. </main><!-- #main -->
  64. <?php if (iro_opt('pagenav_style') == 'ajax') { ?>
  65. <div id="pagination"><?php next_posts_link(__(' Previous', 'sakurairo')); ?></div>
  66. <div id="add_post"><span id="add_post_time" style="visibility: hidden;" title="<?php echo iro_opt('page_auto_load', ''); ?>"></span></div>
  67. <?php } else { ?>
  68. <nav class="navigator">
  69. <?php previous_posts_link('<i class="fa-solid fa-angle-left"></i>') ?><?php next_posts_link('<i class="fa-solid fa-angle-right"></i>') ?>
  70. </nav>
  71. <?php } ?>
  72. </div><!-- #primary -->
  73. <?php
  74. get_footer();