Jump to content

How to display blog posts?


themovieaddict

Recommended Posts

Hi,

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. :)
Link to comment
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,
[code]<?php
$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'];
}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.