我需要在post_title和类别上使用LIKE执行WP_Query
此query_post无效
query_posts(
array(
'post_type' => 'add_buying',
'like' => $keywords,
'posts_per_page' => 5,
'taxonomy' => 'add_country',
'term' => 'drawing'
));
Run Code Online (Sandbox Code Playgroud)
检查此网址并更改like参数.
query_posts( array(
'post_type' => 'add_buying',
's' => $keywords,
'posts_per_page' => 5,
'taxonomy' => 'add_country',
'term' => 'drawing'
));
Run Code Online (Sandbox Code Playgroud)
小智 5
将您的第二个参数更改为“ s”,我认为它将起作用:
$args = array(
'post_type' => 'post',
's' => $search_term,
'post_status' => 'publish'
);
$wp_query = new WP_Query($args);
Run Code Online (Sandbox Code Playgroud)
还有祝你好运
| 归档时间: |
|
| 查看次数: |
23201 次 |
| 最近记录: |