• Home
  • About
  • Contact
  • Disclaimer
  • Sitemap

Too Many Secrets

Feed on
Posts
Comments
« Dynamic title and meta tags
Bido off to a good start »

Automate your header and footer

Jun 21st, 2008 by Richard

So is domain parking not making you the money it used to and you are thinking about biting the bullet and developing a few of your best domains?

Where to start

You need to build pages, write content, get links and more. There is a lot of work to do. I like to automate as much of it as possible. I like to make a header file, footer file and maybe a navigation file if your navigation is not in your header.

Then I take my template, include my header and footer and stamp out page after page with the content that I have written.

When I am all done, I surely have missed something and now I need to update my navigation menu in my header. Perhaps I made a typo, or missed a link to a page. Do I edit each of the 50 pages that I just built to fix that?

No way, I just make the change to one file - my header file - and the changes are included in all of my 50 pages.

How it works

Building a header and footer file is very easy. All you need is take your web site template, cut out your header code and put it into a separate file (I call mine header.php) and then do the same for your footer (I call mine footer.php).

Once you have done that, you use the php include() function in your template file to dynamically put your header and footer back into your web site pages when they are loaded. This way, you simply make changes to your header.php and footer.php files if you want to change your logo, change your menu, add a new link to the footer etc.

Yes, it’s that easy.

Sample code

Below are links to some sample code demonstrating just how simple it is to dynamically include your header and footer into your web pages. To use the code, just download the .txt files, then upload them to your web space, then rename the files to .php and load the page.php in your web browser.

Sample header
Sample footer
Template page

If you have any problems or questions, please make a comment and I will be happy to help you.

Once you have mastered the header and footer, read my post about how to create dynamic title and meta tags.

Enjoy !

Related Posts
  • Mini site development - Part 1
    Developing domains into mini sites or fully developed sites can seem li...
  • Avoid wordpress duplicate content
    Have you wondered why your wordpress blog doesn't rank very well, even for ...
  • Automatically add avatars to your web site
    I was having a conversation with some friends about how easy it is to dynam...

Posted in Web Site Development

2 Responses to “Automate your header and footer”

  1. on 21 Jun 2008 at 8:19 pm1Dynamic title and meta tags

    [...] « How to avoid down time Automate your header and footer [...]

  2. on 30 Jun 2008 at 6:20 pm2Mini site development - Part 1

    [...] basic elements such as a header, footer, navigation and content. By using a well coded template and automating your header and footer and title and meta tags, the only work left for you to do is write [...]

  • Latest Posts

    • Rank using an anchor text keyword matrix
    • Domainers can learn from Beijing Olympics
    • How to fix Bido
    • Tax time for domainers?
    • Block bad bots from your site
  • Categories

    • Domaining (5)
    • Funny Stories (1)
    • Reviews (2)
    • Web Hosting Tips (9)
    • Web Site Development (5)
  • Popular Posts

    • How to redirect based on referer
    • Fix your wordpress permalink structure
    • Avoid wordpress duplicate content
    • Domainers have a bad reputation
    • Block bad bots from your site

Too Many Secrets © 2008 All Rights Reserved.