Adding PHP RSS feeds to your website

RSS means Really Simple Syndication. This is used to publish frequently updated content such as blog entries, news headlines etc. An RSS document or a “feed” contains a summary of content from an associated web site. Adding RSS feeds to your web pages with PHP will provide fresh content for the search engines to give better rank for your sites. This is an advantage over RSS in Javascript which is not search engine friendly. Adding the code to html, php and shtml pages have been described below:-

How to add PHP RSS code to an HTML site

1) Create a file say, rssfeeds.php. Add the PHP code that was given to you by the RSS reader to this file and save this in the root directory of the website.

2) Add the following SSI call to your web pages where ever you want to display RSS headlines:-


<!–#include virtual=”/rssfeeds.php” –>

3) Add the following lines of code in a .htaccess file:

.htm server parsed
.html server parsed
OR

Addhandler application/x-httpd-php .html .php

How to add PHP RSS code to a PHP site

Here you need to add the PHP code produced by the RSS reader to your PHP pages without modifying it. You may add this in the page anywhere that you want to display the headlines. There is no need for editing the .htaccess file.

How to add PHP RSS code to a SHTML site

Add the following SSI code to your pages where ever you want the headlines to appear:

<!–#include virtual=”/rssfeeds.php” –>

Now, create a file on the root directory of your website called rssfeeds.php and copy the PHP code produced by the RSS reader into this file. There is no need for editing the .htaccess file.

Both comments and pings are currently closed.

Comments are closed.