I'm doing a query from my wordpress blog database where I display a list of the latest posts. $sql = "select * from wp_posts order by post_date limit 0,8"; My problem is it seems to display several headlines multiple times. My guess is the post date is saved after editing or saving a post, therefore showing it multiple times. How can I get around this. How does the blog itself display them properly?
Your query will be picking up page names and attachments, you need to reduce this to only show posts. Try this:- $sql = "select * from wp_posts where post_type = 'post' order by post_date limit 0,8";