是否可以使用WP_Query或使用标题的query_posts创建帖子循环?
即
$args = array('post_title'='LIKE '.$str.'% ');
$res = WP_Query($arg);
// the loop...
// trying this now...
$mypostids = $wpdb->get_col("select ID from $wpdb->posts where post_title like 'Abb%' ");
echo count($mypostids).", "; // works but can't echo out array of IDs for the next args?
$args = array(
'post__in'=> $mypostids
);
$res = WP_Query($args);
while( $res->have_posts() ) : $res->the_post(); ...
$wp_query
)外,它的工作效果很好,该参数似乎不属于过滤器回调的一部分(请参见codex.wordpress.org/Plugin_API/Filter_Reference/posts_where),并且会产生错误。