Jump to content


This topic is now archived and is closed to further replies.


How to display blog posts?

Recommended Posts


I've just installed WordPress on my server and essentially what I'd like to do on my website is use WordPress to post news updates. I was wondering how to display posts from a category on a .PHP page of my website.

Example: let's say the index page of my website is "/index.php" and the main page is my site template with room for text in a large table below. How do I put my blog posts inside that table? Is there some type of include code I'd use to grab posts from the blog?

Thanks in advance for any help. :)

Share this post

Link to post
Share on other sites
Wrong section, you should be posting them in 3rd party script.

Hmm.. Read up the FAQ, there's example for getting datas from database.

Below is just an example,
$query = "SELECT * FROM wp_posts WHERE post_status ='publish' ORDER BY ID DESC";
$result = mysql_query($query) or die("Query Error " . mysql_error());
while ($row = mysql_fetch_assoc($result))
echo $row['post_content'];

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.