Adding Legacy, static web pages to your Word Press Site

29th March, 2008 – 8:13 pm

I’ve just spent an hour or two removing some rubbish javascript from my old website and hacking together a php menu at the top of each page. I wanted these old pages to be displayed in my WordPress powered site – I knew it must be easy to add these links to the theme but it wasn’t obvious in the FAQ’s or from Googling. Here’s how I did it:

1) Edit your Theme in the WordPress Theme Editor

2) Select header.php

3) Look for

<li><a href=”<?php bloginfo(‘url’); ?>”>Home</a>

</li> <?php wp_list_pages(‘title_li=’); ?>

Now, if you copy the first line, remove the dynamic <?php ?> code and put in your static links… e.g.

<li><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>

<li><a href=”/cv.php”>CV</a></li> <li><a href=”/travel/travel.php”>Travel</a></li>

<li><a href=”/pic_content.php”>Pictures</a></li> <?php wp_list_pages(‘title_li=’); ?>

and viola, your WordPress site now has your old pages linked, of course you will have to add a link to your old menu to take you back to your WordPress site.

Post a Comment