You could use php to dynamically load all of your pages within your main index page. Then your index page could contain the area in which you don't want your content to change. I use this method on my side and I find things a lot easier to manage.
What you would do, is this.
1. Take the main page on your site, your index page and remove all the text content form it (This would be the area in the center of your site, where you want your other pages to appear), leaving just the outer structure of the page.
2. Where the content was previously, you'll need to paste this php code:
You'll obviously need to replace 'page1' and 'page1.php' etc to the names/file names of your pages. These can also be html files.
3. In your other pages, remove any page formatting/structure, leaving just the text. Re save them.
4. Once that's done, you'll need to change the links in your navigation from 'home.php', 'about.php' etc to something such as 'index.php?page=home' and 'index.php?page=about'.
5. Test your site, see if it works.
What you would do, is this.
1. Take the main page on your site, your index page and remove all the text content form it (This would be the area in the center of your site, where you want your other pages to appear), leaving just the outer structure of the page.
2. Where the content was previously, you'll need to paste this php code:
CODE
switch ( $_GET['page'] ) {
default:include('page1.php');
break; case"page2":include('page2.php');
break; case"page3":include('page3.php');
break; case"page4":include('page4.php');
break; case"page5":include('page5.php');
} ?>
default:include('page1.php');
break; case"page2":include('page2.php');
break; case"page3":include('page3.php');
break; case"page4":include('page4.php');
break; case"page5":include('page5.php');
} ?>
You'll obviously need to replace 'page1' and 'page1.php' etc to the names/file names of your pages. These can also be html files.
3. In your other pages, remove any page formatting/structure, leaving just the text. Re save them.
4. Once that's done, you'll need to change the links in your navigation from 'home.php', 'about.php' etc to something such as 'index.php?page=home' and 'index.php?page=about'.
5. Test your site, see if it works.
0 comments
Post a Comment