How to PHP Tips Web Development

How to integrate a blog RSS feed into a PHP page

What comes first your wordpress blog or your website?

You might have started with a free wordpress blog. Then later created a separate website or vice versa. Well whichever way round it is. You might have ended up with two disconnected websites. Now you want to reuse your blog content in your website.

One easy way to do this and integrate your blog content in your website is using its RSS feed. Which is available on your wordpress blog. Just add this query string “?feed=rss” to your blog’s url and you will get an RSS feed from your blog.

Try it now in your web browser, by clicking on this link:

Now that you can access the RSS feed, you can parse the RSS data into your page

Last RSS is a PHP RSS parser. Available to download as a single file here:

So you can now parse the RSS feed. With a few lines of PHP code as demonstrated below. This is based on one of Last RSS’s examples.

If you found this post useful, please subscribe below. If you have any questions, don’t hesitate to leave a comment…