I am wondering what the PHP code would be to display the last 4 blog posts on another page.
I have an existing homepage which links to the WP blog, but I want the last 4 posts to be displayed on the side of the homepage, just can't figure out the code to make this happen.
Thanks so much!
WordPress: Display last 4 blog posts on homepage
Moderator: General Moderators
-
IanMcGreene
- Forum Newbie
- Posts: 1
- Joined: Tue Oct 24, 2006 7:56 pm
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
You are going to have to either dig into the tables or find the function the_post() and grab the SQL used in it. Then set the limit on the query to 4. Bear in mind that the app does things to the date format and the categorization. If you are just wanting the posts (without all the extra stuff) you should be able to get away with a straight query.