1
林在這裏最差的WordPress的代碼工作的「草稿」的帖子,基本上有運行獲取最新的博客文章列表的MySQL查詢:WordPress的 - 排除在最新的博客文章列表
$query3="select p.post_title, wpr.object_id, wp_terms.name, p.post_date, p.post_content, p.ID
from wp_terms
inner join wp_term_taxonomy on wp_terms.term_id = wp_term_taxonomy.term_id
inner join wp_term_relationships wpr on wpr.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
inner join wp_posts p on p.ID = wpr.object_id
where taxonomy= 'category' and p.post_type = 'post' and wp_terms.name = 'blog'
order by p.post_date DESC LIMIT 4;";
$result3 = mysql_query ($query3);
然而,這是還返回包含設置爲「草稿」的帖子的列表。任何人都知道我需要調整上述查詢的表名和列名不顯示草稿博客帖子?