Hi, I am trying to get my blogs latest posts title to appear on my sites homepage. Basically what i want is, everytime i write a new blog post ( i use wordpress), i want a small piece of text saying, 'Latest Blog Post' and then the title of that blog post and if possible the first few words from the post. Does anyone know how i would go about doing this? Thanks for any help.
Hi You could use CARP & pull the latest post off your blogs RSS feed. the site is here http://www.geckotribe.com/rss/carp/. It very configurable. Just set it up to pull the title only off the latest RSS entry. Hope this helps Regards Brian
<?php $xml = simplexml_load_file( "your_rss_feed.xml" ) ; $blog = $xml->channel; $blogEntries = $blog->item; echo $blogEntries->title . "\n"; ?> PHP: Couldn't you just do that?
i tried it gordaen, but i just keep getting this error, Fatal error: Call to undefined function: simplexml_load_file() in /home/public_html/testfeed.php on line 10 this is my feed url, adquick.co.uk/blog/?feed=rss2 and i have just put that where you had this line, $xml = simplexml_load_file( "your_rss_feed.xml" ) i replaced your_rss_feed.xml with http://adquick.co.uk/blog/?feed=rss2 have i done that right?
Try this tutorial for PHP4. If you have a little php knowledge you should be able to figure it out without oo much difficulty. http://www.bmindful.com/api.aspx
You can also use file_get_contents function to read the xml and then get relevant information from there. That's what I have done on my directory . See the update,news,free stuff heading on right side. Bye
Hi Jeet, i like the look of what you have done there. I am still a beginner when it comes to php and what all these functions mean, so would you be willing to explain in detail what i need to do to copy what you did with the file_get_contents function? Thanks Jeet.