endloser
Member
Posted 3 years ago #
Hi,
My site runs on PHP / Smarty and I have a WordPress blog in a subdirectory.
I'd like to be able to keep the home page as a "regular" PHP page (not generated out of WordPress) but have a block on the home page that automatically displays a snippet of the latest blog post.
Know any easy way to do this or examples?
Thanks!
Code like this will do it:
include('./blog-subdirectory/wp-blog-header.php');
query_posts('showposts=1');
while(have_posts()): the_post();
the_title();
the_content();
// whatever you want to display from the post in here
endwhile;
Basically, just include the WordPress code, manually specify your query, then create a normal Loop.