0
私は、テーブル postmetaを表示ダニや情報検索を検索するローカルホストにコードを入力することができます カスタムフィールド を使用して検索フォームを作りたい
しかし、サイトは、私はXAMPP 使用 をロードしません。何が問題ですか?wp_query複数のメタキー
これあなたがあなたのクエリの関係部分が欠落している私のコード
<?php
$args = array(
'post_type' => 'house',
'meta_query' => array(
array(
'key' => 'city',
'value' => $_GET["city"],
'compare' => 'LIKE',
),
array(
'key' => 'part',
'value' => $_GET["part"],
'compare' => 'LIKE',
),
array(
'key' => 'statuss',
'value' => $_GET["statuss"],
'compare' => 'LIKE',
),
array(
'key' => 'typee',
'value' => $_GET["typee"],
'compare' => 'LIKE',
),
array(
'key' => 'statuss',
'value' => $_GET["statuss"],
'compare' => 'LIKE',
),
array(
'key' => 'rooms',
'value' => $_GET["rooms"],
'compare' => 'LIKE',
),
array(
'key' => 'wcss',
'value' => $_GET["wcss"],
'compare' => 'LIKE',
),
array(
'key' => 'metr',
'value' => $_GET["metr"],
'compare' => 'LIKE',
),
array(
'key' => 'minip',
'value' => $_GET["minip"],
'compare' => 'LIKE',
),
array(
'key' => 'maxp',
'value' => $_GET["maxp"],
'compare' => 'LIKE',
),
array(
'key' => 'tabaghe',
'value' => $_GET["tabaghe"],
'compare' => 'LIKE',
),
array(
'key' => 'rahn',
'value' => $_GET["rahn"],
'compare' => 'LIKE',
),
array(
'key' => 'ejareh',
'value' => $_GET["ejareh"],
'compare' => 'LIKE',
)
)
);
$all_posts = new WP_Query($args);
if ($all_posts->have_posts()) :?>
<div class="titSearchHouse"
style="text-align: center;width: 150px;margin: 12px auto 0;background: #d0d0d0;color: #FFFFFF;font-family: 'B Yekan';padding: 10px">
display results
</div>
<div class="parti">
<?php while ($all_posts->have_posts()):$all_posts->the_post(); ?>
<!--start post wrapper-->
<a class="post-link" href="<?php echo get_the_permalink(); ?>">
<div class="post wow fadeInUp">
<div class="post-inner">
<div class="post-thumb">
<?php echo get_the_post_thumbnail($all_posts->post->ID, 'main-thumbnail'); ?>
</div>
<span
class="post-title"><?php echo get_the_title($all_posts->post->ID); ?></span>
</div>
<div class="post-meta">
<span><i
class="fa fa-clock-o"></i><?php echo get_the_date('Y-m-d', $all_posts->post->ID); ?></span>
<span><i class="fa fa-user"></i><?php echo get_the_author(); ?></span>
<span><i class="fa fa-thumbs-o-up"></i>506</span>
</div>
</div>
</a>
<!--end post wrapper-->
<?php endwhile; ?>
</div>
wp_reset_postdata();
<?php endif; ?>
ありがとう
よりお手数ですが、しかし、答えは – Ali
私は知っているが、まだ能力のコメントを持っていない、ちょうど私がそれを指摘する必要があると思った:) –