I need to put in a landingpage that is in HTML the last posts of a blog that is in Wordpress, I got a code on the internet that after the posts but I can not define how many posts will appear and nor get the image of the post. Can someone help me?
If you have any other code that does this too.
Thank you.
<?php
$url = 'http://blog.empresa.com.br/category/empresa/feed/';
$xml = simplexml_load_file($url);
$item = '1';
if($xml !== false){
echo '<div class="blog">';
foreach($xml->channel->item as $node){
printf('<h5><a href="%s">%s</a></h5>', $node->link, $node->title);
printf($node->description);
}
echo '</div>';
}?>