Ronald A. Richardson.com
i burn in your atmosphere



PHP Template Wrap x. Tutorial x. Integration Template Wise x. Wordpress
comment 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:

< ?php get_footer(); ? >

Alright now that we have a working header and footer for your wordpress cms/ also can work with any other cms. (Just use the concept, and use it’s own code.)
For example you have a small 1 file php script, such as a calculator…. and it it calculator.php, plain script n code. But it’s in another directory and you want it to be integrated template wise into your wordpress, the code should look like this in {calculator.php}:

< ?php include("/home/website/www/outheader.php"); ? >

< FORM name="Calculator" >
< table border="4" > < !--OUTER BORDER OF CALCULATOR, PANELS-->
< tr > < !--TOP PANEL------>
< td colspan="2">Basic Calculator K0d3
< input type="text" maxlength="40" size="30" name="Display">
< / td >
< / tr > < !--END TOP PANEL--->
< tr >
< td > < !--LEFT PANEL------>
< table >
< tr >
< td >< input type="button" value="7">

< td >< input type= "button" value= "8">< / td >
< td >< input type= "button" value= "9" >< / td >
< /tr >
< tr >
{smililar digits in row}
< / tr >
< / table >
< / td >< !--END LEFT PANEL-->
< td > < !--RIGHT PANEL----->
< table >
{right panel - add numbers}
< / table>
< / td>< !--END RIGHT PANEL->
< / tr>

< / FORM>

< ?php include("/home/website/www/outfooter.php"); ? >


And that is how you would wrap your wordpress theme around another script. Integration template wise! -Ron Don

DOWNLOAD/GET THE CODE!!!

If you enjoyed the article, why not subscribe?

Related Post

  • No Related Post

Post a Comment

About The Author: Ronald

I am Ronald A. Richardson, champion of the underworld!

Want to subscribe?

 Subscribe in a reader Or, subscribe via email:
Enter your email address: