If your website has regular web pages and a blog, you can easily use the same header, footer, and other parts of your WordPress blog on your web pages so they all have the same look and feel.

Here is the trick:

Within the html web page the header information for the blog is incorporated using this code:

<?php
require(’./wp-blog-header.php’);

include $_SERVER['DOCUMENT_ROOT'].”/wp-content/themes/YOURTHEME/header.php”;
?>

Similarly, footer information from the blog is inserted into the html page with this code:

<?php
require(’./wp-blog-header.php’);

include $_SERVER['DOCUMENT_ROOT'].”/wp-content/themes/YOURTHEME/footer.php”;
?>

Finally, even the sidebar from the blog is included, to add that final touch which makes the web page virtually indistinguishable from blog pages:

<?php
require(’./wp-blog-header.php’);

include $_SERVER['DOCUMENT_ROOT'].”/wp-content/themes/YOURTHEME/sidebar.php”;
?>

There is a downside, though, and that is getting better SEO from a static web page since only a default page title, and maybe a description, will be pulled in from the blog header.

This technique was done at Michael Jackson Funeral but then the static pages were replaced with WordPress pages due to these SEO concerns.

Copy the code below to your web site.
x 
Leave a Reply