PHP Template Wrap x. Tutorial x. Integration Template Wise x. Wordpress
No Comments Written by
Ronald on
October 12, 2007 – 11:18 pm
Alright so here I go, for the example I will use is a wordpress blog. Alright and you want to integrate the template onto another php script to look like its all in wordpress. Heres how you would go about doing that… Starting with getting your code from your header, to create another custom header that works outside of wordpress using a “< ? include" still having all the available wordpress functions and attributes and functions. Such as 'blog_info'. NOTE: The same would go for phpnuke or any other php website, cms/script. Below, I am pasting the sample code for a sample page you can use to show the WP footer and header on pages outside your WP installation. Note: you should name the file *.php and the code for this is for you to place it within the root of the WP installation. DO NOT JUST COPY AND PASTE, THESE ARE EXAMPLES. I added spaces inbetween the tags to make them appear in the post…. just DOWNLOAD THE CODE AT THE BOTTOM! DOWNLOAD/GET THE CODE!!!
This first part would be called for example “outheader.php” it should be made into your root folder
< ?php require('wp-blog-header.php'); ? >< ?php get_header(); ? >
< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml">
< head profile="http://gmpg.org/xfn/11" >
< meta http-equiv="Content-Type" content="< ?php bloginfo('html_type'); ? >; charset=< ?php bloginfo('charset'); ?>” / >
< title >< ?php bloginfo('name'); ? > < ?php if ( is_single() ) { ?> ยป Blog Archive < ?php wp_title(); ? >< /title>< ?php wp_head(); ?>
< /head>
< body>
That there would display the header of your wordpress template, and it will work on any other cms/website/script!Just incase you didn't know, that you cannot do it like this:
"< ?php include("/home/website/www/wp-content/themes/classic/header.php"); ? >”
That will not work, but instead use your new header, that we created…. ” < ?php include("/home/website/www/outheader.php"); ? > “
Now for the second part which is the footer. This is small and easy. SImply create a file called “outfooter.php” in your root directory… NOw put this code in it:
