File: /var/www/html/wp-content/themes/ganryujima_new_1606 backup/search.php
<?php
/*
Template Name: Search Page
*/
?>
<?php include('partials/_header.php'); ?>
<?php if(wp_is_mobile() && !is_Kindle() && !is_ipad()){
include('partials/_global_nav_sp.php');
} else {
include('partials/_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="m-outer-cover 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 } ?>
<span class="cat bg-r6">
<?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>
</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(); ?>
</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('partials/_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('partials/_footer.php'); ?>