HEX
Server: Apache
System: Linux 4485441ca2e2 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 11:03:07 UTC 2025 aarch64
User: (1000)
PHP: 8.2.24
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/themes/ganryujima_new_1602/search.php
<?php
/*
Template Name: Search Page
*/
?>
<?php include('_header.php'); ?>
<?php if(wp_is_mobile() && !is_Kindle() && !is_ipad()){
  include('_global_nav_sp.php');
} else {
  include('_global_nav.php');
} ?>
<div id="flakes1"></div>
<div id="flakes2"></div>
<div id="flakes3"></div>
<div class="container">
  <h1 class="page-title">検索結果</h1>
  <?php if(wp_is_mobile() && !is_Kindle() && !is_ipad()){
    echo '<section class="l-column">';
  } else {
    echo '<section class="l-column table">';
  } ?>
    <section class="l-main">
      <div class="m-search-condition">
        <span>検索ワード</span>
        <i><?php echo get_search_query(); ?></i>
        <span class="right">
          結果<?php echo $wp_query->found_posts; ?>件
        </span>
      </div>
      <?php $paged = get_query_var('paged'); query_posts($query_string.'&posts_per_page=20&paged='.$paged); ?>
      <?php if(have_posts()): ?>
        <div class="l-lists">
          <?php while(have_posts()): the_post(); ?>
            <?php
              $img = get_field('news_list_thumbnail');
              $imgurl = wp_get_attachment_image_src($img, '3-2');
            ?>
            <article class="table_article m-article-search" alt="<?php the_permalink(); ?>">
              <a href="<?php the_permalink() ?>">
                <div class="cover">
                  <?php if($imgurl){ ?>
                    <img class="image" src="<? echo $imgurl[0]; ?>" alt="">
                  <?php } else { ?>
                    <img src="<?= home_url() ?>/assets/images/dummy3-2.jpg" alt="SAMURAI WARRIOR">
                  <?php } ?>
                </div>
                <div class="cnt">
                  <h1>
                    <?php if(mb_strlen($post->post_title)>40) {
                      $title= mb_substr($post->post_title,0,40);
                      echo $title.'...';
                    } else {
                      the_title();
                    }?>
                  </h1>
                  <?php the_excerpt(); ?>
                  <aside class="info">
                    <span class="cat">
                      <?php
                        if (get_post_type()=='post') :
                          echo 'news';
                        elseif (get_post_type()=='grjm_discussion') :
                          echo '議論';
                        elseif (get_post_type()=='grjm_budo') :
                          echo '武道とは';
                        elseif (get_post_type()=='grjm_event_results') :
                          echo '試合結果';
                        elseif (get_post_type()=='grjm_events') :
                          echo 'イベント情報';
                        elseif (get_post_type()=='grjm_fighter') :
                          echo '選手名鑑';
                        else :
                          echo 'その他';
                        endif;
                      ?>
                    </span>
                    <time><?php the_time('Y/m/d') ?></time>
                  </aside>
                </div>
              </a>
            </article>
          <?php endwhile; ?>
        </div>
      <?php else : ?>
      	<p>検索条件にヒットした記事がありませんでした。</p>
      <?php endif; ?>
      <div class="pagination"><?php wp_pagination(); ?></div>
      <?php wp_reset_query(); ?>
    </section>
    <section class="l-side">
      <?php include('_side_column.php'); ?>
    </section>
  </section>
</div>
<script type="text/javascript">
  jQuery(function() {
    var   bgh1 = 0;
    var   bgh2 = 0;
    var   bgv1 = 0;
    var   bgv2 = 0;
    jQuery(window).scroll(function() {
      bgh1+= 0.4;//マイナスは左に、プラスは右に移動します。
      bgv1+= 2;//マイナスは上に、プラスは下に移動。
      bgh2+= -1;
      bgv2+= 4;
      jQuery("#flakes1").css("background-position", bgh1 + "px " + bgv1 + "px");
      jQuery("#flakes2").css("background-position", bgh2 + "px " + bgv2 + "px");
    });
  });
</script>
<?php include('_footer.php'); ?>