wordpress 获取分类文章mysql 命令
select ID,post_title,post_date,post_name from wp_posts,wp_term_relationships,wp_term_taxonomy where ID=object_id and wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id and post_type=’post’ and post_status = ‘publish’ and wp_term_relationships.term_taxonomy_id = 6 and taxonomy = ‘category’ order by ID desc 进入wp_term_taxonomy 表,count排序,对应数字和后台category的对应篇数对应上。前面的term_taxonomy_id就是真正的分类序号。 没有Hash:的分类文章 select ID,post_date,post_title from wp_posts,wp_term_relationships,wp_term_taxonomy where ID=object_id and wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id and post_type=’post’ and `post_content` not REGEXP ‘Hash:’ and post_status = ‘publish’ and wp_term_relationships.term_taxonomy_id = […]
. Read more
