我有以下 wp 查询:
$keyword = $_GET['se'];
$args = array(
's' => $keyword,
'post_type' => 'page',
'posts_per_page' => '10',
'meta_query' => array(array('key' => 'Active','value' => 'yes' ),
array('key' => '_wp_page_template','value' => 'default' )
),
'orderby' => 'post_date',
'order' => 'DESC',
'showposts' => -1,
'paged' => $paged
);
$qu = new WP_Query($args);
while ( $qu->have_posts() ) :
$qu->the_post();
the_title();
the_excerpt();
endwhile;
wp_reset_postdata();
?>
如果我不包含 's' => $keyword,它会返回您所期望的,但只要我包含所述关键字,它就不会返回任何内容。该关键字在数据库中确实有匹配项。有谁知道为什么?我在哪里错了?
谢谢