임 새롭고 WP가 너무 좋아서 pls는 내 무지를 배우려고 노력하고 있습니다.검색 post_like + 하나의 루프에서 택시 노미 체크 박스로 검색
그래서 두 개의 Wp_Query (검색 창에 입력하여 검색하고 분류 기준에 따라 검색하여 검색) 및 나는 그들을 혼합하는 방법을 모릅니다 ... 두 번째 및 해당 cricle 작동하지 않는 경우.
<?php
global $search_ingr;
if(isset($search_ingr)) {
global $loop;
} else {
$query_params = getQueryParams();
if(isset($query_params['search'])) {
$query_params['post_title_like'] = $query_params['search'];
unset($query_params['search']);
}
$loop = new WP_Query(array(
'numberposts' => 60,
'posts_per_page' => 60,
'orderby' => 'title',
'order' => 'ASC',
'post_type' => 'products',
'post_status' => 'publish'
));
}
?>
<?php if(isset($search)): ?>
<div class="search-matches"><h4>Wyniki wyszukiwania:</h4><hr></div>
<?php endif; ?>
<?php if ($loop->have_posts()) :?>
<?php while($loop->have_posts()) : $loop->the_post(); ?>
<span class="tooltip tooltip-effect-4">
<span class="tooltip-item">
<div class="product">
<a href="<?php the_permalink(); ?>">
<div class="product-thumbnail"><span class="helper"></span><?php the_post_thumbnail(); ?></div>
<div class="product-name"><?php the_title(); ?></div>
</a>
</div>
</span>
<a href="<?php the_permalink(); ?>">
<span class="tooltip-content clearfix">
<?php the_post_thumbnail(); ?>
<span class="tooltip-text"><?php the_title(); ?></span>
</span>
</a>
</span>
<?php endwhile; ?>
<?php endif; ?>
꽤 긴 코드의 평안함, 루프와 함께 붙이며 검색 상자와 분류 목록이 있습니다.
// $loop = new WP_Query(array(
// 'numberposts' => 60,
// 'posts_per_page' => 60,
// 'orderby' => 'title',
// 'order' => 'ASC',
// 'post_type' => 'products',
// 'post_status' => 'publish'
// ));
모두 검색이 잘 작동 (하지만 난 후 주문 및 게시물의 수를 제어하지 못할) :
또한 나는이를 제거 할 때. 그 어떤 도움이 필요합니까?