🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
users
/
2
/
fujibow
/
web
/
ra-in-bow.co.jp
/
wp-content
/
themes
/
rainbow_theme
✏️
Editing: search.php
<?php get_header();?> <div id="content" class="single subpage"> <div class="head_tit"> <div class="panlist"> <a href="<?php echo home_url();?>">HOME</a> <span>施工実績</span> </div> <!-- /.panlist --> <div class="ib"> <h2> <img src="<?php echo gdu();?>/img/tit3.svg" alt=""> <span>施工実績</span> </h2> <div class="tit"> 積み重ねてきた実績、<br> 技術の集積が、<br> ここにあります。 </div> <!-- /.tit --> </div> <!-- /.ib --> </div> <!-- /.head_tit --> <div class="search_area"> <div class="ib"> <form action="#result"> <input type="hidden" name="s" value=""> <div class="row"> <span>地域</span> <div class="checks"><?php output_custom_taxonomy_checkboxes('area',0); ?></div> <!-- /.cheks --> </div> <!-- /.row --> <div class="row"> <span>工種</span> <div class="checks"><?php output_custom_taxonomy_checkboxes('kind',0); ?></div> <!-- /.cheks --> </div> <!-- /.row --> <button type="button" class="button"><span>検 索</span></button> </form> </div> <!-- /.ib --> </div> <!-- /.search_area --> <div class="content_contents archive"> <div class="ib"> <?php get_header(); // ヘッダーの読み込み // 検索クエリのカスタマイズ $tax_query = array('relation' => 'AND'); // ANDで2つの条件を組み合わせる // `area` の条件を追加 if (!empty($_GET['area'])) { $area_terms = array_map('sanitize_text_field', $_GET['area']); $tax_query[] = array( 'taxonomy' => 'area', 'field' => 'slug', 'terms' => $area_terms, 'operator' => 'IN', ); } // `kind` の条件を追加 if (!empty($_GET['kind'])) { $kind_terms = array_map('sanitize_text_field', $_GET['kind']); $tax_query[] = array( 'taxonomy' => 'kind', 'field' => 'slug', 'terms' => $kind_terms, 'operator' => 'IN', ); } // WP_Queryのパラメータを構築 $args = array( 'post_type' => 'your_post_type', // 対象となる投稿タイプを指定 'tax_query' => count($tax_query) > 1 ? $tax_query : '', // 条件がある場合のみtax_queryを設定 'paged' => get_query_var('paged', 1), // ページネーション対応 ); // クエリを実行 $query = new WP_Query($args); ?> <?php if ($query->have_posts()) : ?> <div class="work_list" id="result"> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php echo get_template_part('parts/work_box'); ?> <?php endwhile; ?> </div> <!-- /.work_list --> <!-- ページネーション --> <div class="pagination"> <?php echo paginate_links(array( 'total' => $query->max_num_pages, 'current' => max(1, get_query_var('paged')), 'prev_text' => '前へ', 'next_text' => '次へ', )); ?> </div> <?php else : ?> <p>条件にマッチする実績はありません。</p> <?php endif; ?> <?php wp_reset_postdata(); ?> </div> </div> </div> <?php get_footer();?>
💾 Save Changes
❌ Cancel