Welcome to WebmasterWorld Guest from 54.147.134.218

Forum Moderators: incrediBILL

Message Too Old, No Replies

Creating a list of latest posts

     
2:08 am on Feb 22, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 14, 2009
posts: 41
votes: 0


Hi,

If I have a blog and want the titles of my latest 5 posts to appear automatically in a list on my home page, is there a way to do it with basic html/css? or does it need a script?

I'm looking for a way to have the latest 5 posts to appear without having to create the link and input the name every time.

Thanks

:-)
8:58 am on Feb 22, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Yes, a few lines of PHP and mySQL code can pull the titles of the latest 5 entries from the database and show them in a box.

If it is popular blog software, it is likely someone has already written just such an extension.
11:21 am on Feb 22, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 14, 2009
posts: 41
votes: 0


Thanks for the reply.

It is just a plain html css site. I normally use Joomla, but not this time :-) Any ideas on a bit of script linked with a txt file maybe?

Thanks
5:26 pm on Feb 22, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Are you saying the blog uses flat files, and not a database?

If so, then you could:
- set the server configuration so that .html files are parsed for PHP content,
- use a PHP include to "include" a file which will contain the list of links.

In future you'll only need to alter that file once to change all links on the site.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members