search.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. <i class="iconfont icon-search"></i>
  34. <input class="text-input" type="search" name="s" placeholder="<?php _e('Search...', 'sakurairo') ?>" required>
  35. </form>
  36. <!-- search end -->
  37. </div>
  38. <?php
  39. get_template_part('tpl/content', 'none');
  40. endif; ?>
  41. <style>
  42. .nav-previous,
  43. .nav-next {
  44. padding: 20px 0;
  45. text-align: center;
  46. margin: 40px 0 80px;
  47. display: inline-block;
  48. font-family: miranafont, "Hiragino Sans GB", "Microsoft YaHei", STXihei, SimSun, sans-serif;
  49. }
  50. .nav-previous,
  51. .nav-next a {
  52. padding: 13px 35px;
  53. border: 1px solid #D6D6D6;
  54. border-radius: 50px;
  55. color: #ADADAD;
  56. }
  57. .nav-previous,
  58. .nav-next span {
  59. color: #989898;
  60. font-size: 15px;
  61. }
  62. .nav-previous,
  63. .nav-next a:hover {
  64. border: 1px solid #A0DAD0;
  65. color: #A0DAD0;
  66. }
  67. </style>
  68. </main><!-- #main -->
  69. </section><!-- #primary -->
  70. <?php
  71. get_footer();