search.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * The template for displaying search results pages.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  6. *
  7. * @package Akina
  8. */
  9. get_header(); ?>
  10. <section 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') || !get_random_bg_url()) { ?>
  15. <header class="page-header">
  16. <h1 class="page-title"><?php printf(__('search result: %s', 'sakurairo')/*搜索结果*/, '<span>' . get_search_query() . '</span>'); ?></h1>
  17. </header><!-- .page-header -->
  18. <?php } ?>
  19. <?php
  20. /* Start the Loop */
  21. if (iro_opt('post_list_style') == 'akinastyle') {
  22. while (have_posts()) : the_post();
  23. get_template_part('tpl/content', get_post_format());
  24. endwhile;
  25. } else {
  26. get_template_part('tpl/content', 'thumb');
  27. }
  28. the_posts_navigation();
  29. else : ?>
  30. <div class="search-box">
  31. <!-- search start -->
  32. <form class="s-search">
  33. <input class="text-input" type="search" name="s" placeholder="<?php _e('Search...', 'sakurairo') ?>" required>
  34. </form>
  35. <!-- search end -->
  36. </div>
  37. <?php
  38. get_template_part('tpl/content', 'none');
  39. endif; ?>
  40. <style>
  41. .nav-previous,
  42. .nav-next {
  43. padding: 20px 0;
  44. text-align: center;
  45. margin: 40px 0 80px;
  46. display: inline-block;
  47. font-family: 'Fira Code','Noto Sans SC';
  48. }
  49. .nav-previous,
  50. .nav-next a {
  51. padding: 13px 35px;
  52. border: 1px solid #D6D6D6;
  53. border-radius: 50px;
  54. color: #ADADAD;
  55. }
  56. .nav-previous,
  57. .nav-next span {
  58. color: #989898;
  59. font-size: 15px;
  60. }
  61. .nav-previous,
  62. .nav-next a:hover {
  63. border: 1px solid #A0DAD0;
  64. color: #A0DAD0;
  65. }
  66. </style>
  67. </main><!-- #main -->
  68. </section><!-- #primary -->
  69. <?php
  70. get_footer();