This is what i want to do:
I want /summary.php
to include 5 latest posts (only the extract) from my blog, which lives in /wp
.
Is there any way to include Wordpress in /summary.php
and only print the html for these posts? (Maybe i should parse the rss?)
Take a look to Integrating WordPress with your Website
This is an example from that page, that shows the first ten posts in alphabetical order:
<?php
require('/the/path/to/your/wp-blog-header.php');
?>
<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
Use $posts = get_posts('numberposts=10');
if you want the 10 latest posts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With