Pages & Posts both listed under Recent Posts
Both posts and pages are stored the the table wp_posts, but the post_category field is always set to 0 and is not updated when a new post is created. Consequently, even if I amend the line below to select post_categories where the value is more than 0, all pages and posts are listed as being “RECENT POSTS”.
$recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")
So far the only work around I can do is to update the post_category manually. Anybody know how to alter the code to get post_category updated when new posts are created?
- The topic ‘Pages & Posts both listed under Recent Posts’ is closed to new replies.