我需要从2个搜索关键字执行帖子&;通过使用我正在尝试的WP查询将所有内容放在一个循环中显示array_merge
但这对我不起作用,所以我最后的代码是:
please note: i need to excute posts from 2 seprated keywords not one keyword containing 2 words & put the posts from keyword1, keyword2 in the same loop
$argssss=array(\'s\' => \'keyword1\');
$argsss=array(
\'s\' => \'keyword2\',
\'orders\' => \'DESC\',
\'showposts\' => 60
);
$argss=array_merge( $argssss, $argsss );
$queryy = new WP_Query($argss);
if ( $queryy->have_posts() ) :
while ( $queryy->have_posts() ) :
$queryy->the_post();
$do_not_duplicate = $post->ID;
the_title( \'<p>\', \'</p>\' );
endwhile;
wp_reset_postdata();
endif;
我也试着
s
在数组中,但不是这样工作的
array(\'keyword1\',\'keyword2\')
那么,我如何从两个不同的关键字执行帖子呢
这个答案非常好,它通过将2个wp\\U查询合并到一个查询中解决了我的问题Combining queries with different arguments per post type
another note this answer is very very good because it is really merged the two wp_query
in one but i can\'t figure it with my filter
Custom query with category exclusion and post-meta "whitelist"
但是如何在自定义查询中使用pagenavi