Samir's Corner - Written by Samir on Wednesday, July 2, 2008 19:01 - 0 Comments
Quick surefire guide to display latest blog posts on a static html web page
Okay so how do you display latest blog posts on an html page, to make the dynamic fresh content based websites. For e.g. www.guide5.com (see the bottom panel)
If your static page has .php extension then it’s very easy to achieve this but I am going to guide you on how to do this on a static .html page using RSS feeds from the blog
There are many ways to this, you can use JavaScript or free services like Feedburner BuzzBoost which is really great and easy to setup. But search engines don’t read JavaScript that well and SEO programmer‘s like me hate using JavascriptÂ
So here we go!
We will use a php script to convert RSS feeds and display it on the website according to the design template. RSS Feeds could be from your blog, which is on your domain or from blogs on various other domains.
Well PHP scripts do not really work on html pages automatically. You need to process your .html files as PHP.
There are 2 simple options you can use to parse html as php.
1. .htaccess file
2. Cpanel Apache Handler’ Function
Â
.htaccess file method
Open your .htaccess file in notepad and copy paste following line code, save it and upload it
AddType text/html .shtml .shtm .htm .html
AddHandler server-parsed .shtml .shtm .htm .html
Cpanel Apache Handler’ Function method
If you have access to cpanel then it’s very easy to parse html as php
1. Find apache handler icon and click on it
2. After clicking Apache Handlers link, you will go to a page which appear like the following image.  
 3. As you can see on the image, there is no instruction for html page listed Under Defined Handlers
Now add the following
Under Extension(s) add .html
Under Handler add server-parsed
Click on Add button
An Apache handler maintenance screen should appear

Well done! you have parsed html files on your server.Â
Note: if your page has .htm extensions then do the same for your .htm files
(Checkout Apache Handler Function method video NEW)
We are half way through! Now let’s flex those fingers and do little coding
We are going to use a great script made by Feedforall, which you can download here
Download and extract latestblog.zip on your computer, you will find two files latest-post.php and latest-post.html
Open latest-post.php in your favorite html editor. I prefer Dreamweaver, you can also open the file with notepad. You need to look for following codes:
$XMLfilename = “http://examlple.com/feed/”;
$TEMPLATEfilename = “latest-blog.html”;
$FeedMaxItems = 10;
First you need to edit $XMLfilename (url) and replace it with your RSS feeds url
Next! You need to edit max number of post urls you want to display on your html page ($FeedMaxItems)
Tip: To display a particular category of your blog, you just need to put your category feed url instead of your blogs feed url.
Now you need to insert one line code in your static html page, to SSI include your blog feeds
<!–#include virtual=”latest-post.php”–>
Note: you need to save latest-post.php into the same directory as your html file, for the path to work.
You can control the look of your feed by using CSS
That’s it you are done, yes seriously you are done
I know there are several other ways to do this, but this is the easiest and if you feel you have an easier way, do state it down in the comments please.
I hope you liked this tutorial, if yes subscribe to this blog for other cutting edge SEO and internet marketing techniques.
News - Dec 7, 2010 13:33 - 0 Comments
Google Algorithms Revised to counter SEO abuse
- Google Apps Suite Gets Bigger
- Google Instant Previews Lead to Fake Traffic
- BlackHat SEO infiltrates the Net
- RockMelt Browser Combines Online Search with Facebook, Twitter
- Google’s Revenue Shoots Up in an ‘Instant’
Blogging - Dec 30, 2010 10:59 - 0 Comments
A blog a day doesn’t keep the writer’s block away
- Keeping up with Change
- The Write Stuff
- Copy Writing, not Copy Pasting
- A blog a day, brightens your day!
- The linking road to SE0
Search Engine Optimization - Feb 16, 2011 18:33 - 0 Comments
4 important search engine marketing strategies
- Stepping into the SEO industry? Follow these basic tips
- BlackHat SEO infiltrates the Net
- 4 Points a Website Owner Must Know About SEO
- Keeping up with Change
- The Write Stuff
Leave a Reply