{"id":1647,"date":"2008-08-25T13:10:50","date_gmt":"2008-08-25T17:10:50","guid":{"rendered":"http:\/\/teamtutorials.com\/?p=1647"},"modified":"2008-08-27T13:10:19","modified_gmt":"2008-08-27T17:10:19","slug":"simple-php-website-templates","status":"publish","type":"post","link":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates","title":{"rendered":"Simple PHP Website Templates"},"content":{"rendered":"

So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren’t using PHP includes, you will have to update each file. Wouldn’t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.<\/p>\n

This tutorial will require a server that can handle PHP code. If you would like to set one up on your computer, check out Mike’s \u201cInstalling WAMP tutorial<\/a>\u201d.<\/p>\n

First, if you don’t have a website that you would like to break up into a template, you can use the sample 2 column layout <\/a>below from 456bereastreet.com <\/p>\n

\r\n<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01\/\/EN"\r\n        "http:\/\/www.w3.org\/TR\/html4\/strict.dtd">\r\n<html lang="en">\r\n<head>\r\n\t<title>Simple 2 column CSS layout, final layout | 456 Berea Street<\/title>\r\n\t<meta name="description" content="How to create a simple two column CSS layout with full width header and footer.">\r\n\t<meta name="copyright" content="Copyright (c) 2004 Roger Johansson">\r\n\t<meta name="author" content="Roger Johansson">\r\n\t<style type="text\/css">\r\n\tbody,\r\n\thtml {\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t\tbackground:#a7a09a;\r\n\t\tcolor:#000;\r\n\t}\r\n\tbody {\r\n\t\tmin-width:750px;\r\n\t}\r\n\t#wrap {\r\n\t\tbackground:#99c;\r\n\t\tmargin:0 auto;\r\n\t\twidth:750px;\r\n\t}\r\n\t#header {\r\n\t\tbackground:#ddd;\r\n\t}\r\n\t#header h1 {\r\n    \tpadding:5px;\r\n\t    margin:0;\r\n    }\r\n\t#nav {\r\n\t\tbackground:#c99;\r\n\t\tpadding:5px;\r\n\t}\r\n\t#nav ul{\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t\tlist-style:none;\r\n\t}\r\n\t#nav li{\r\n\t\tdisplay:inline;\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t}\r\n\t#main {\r\n\t\tbackground:#9c9;\r\n\t\tfloat:left;\r\n\t\twidth:500px;\r\n\t}\r\n\t#main h2, #main h3, #main p {\r\n\t\tpadding:0 10px;\r\n    }\r\n\t#sidebar {\r\n\t\tbackground:#99c;\r\n\t\tfloat:right;\r\n\t\twidth:240px;\r\n\t}\r\n\t#sidebar ul {\r\n\t\tmargin-bottom:0;\r\n    }\r\n    #sidebar h3, #sidebar p {\r\n\t\tpadding:0 10px 0 0;\r\n    }\r\n\t#footer {\r\n\t\tbackground:#cc9;\r\n\t\tclear:both;\r\n\t}\r\n\t#footer p {\r\n\t\tpadding:5px;\r\n\t\tmargin:0;\r\n    }\r\n\t<\/style>\r\n<\/head>\r\n<body>\r\n<div id="wrap">\r\n\t<div id="header"><h1>Simple 2 column CSS layout, final layout<\/h1><\/div>\r\n\t<div id="nav">\r\n\t\t<ul>\r\n\t\t\t<li><a href="#">Option 1<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 2<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 3<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 4<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 5<\/a><\/li>\r\n\t\t<\/ul>\r\n\t<\/div>\r\n\t<div id="main">\r\n\t\t<h2>Column 1<\/h2>\r\n\t\t<p><a href="\/">456 Berea Street Home<\/a> | <a href="\/lab\/developing_with_web_standards\/csslayout\/2-col\/">Simple 2 column CSS layout<\/a> | <a href="http:\/\/www.456bereastreet.com\/lab\/developing_with_web_standards\/">Developing with web standards index<\/a><\/p>\r\n\t\t<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<\/p>\r\n\t\t<p>Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.<\/p>\r\n\t\t<p>Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.<\/p>\r\n\t\t<h3>Consectetuer adipiscing elit<\/h3>\r\n\t\t<p>Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<\/p>\r\n\t\t<p>Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.<\/p>\r\n\t<\/div>\r\n\t<div id="sidebar">\r\n\t\t<h3>Column 2<\/h3>\r\n\t\t<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna.<\/p>\r\n\t\t<ul>\r\n\t\t\t<li><a href="#">Link 1<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 2<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 3<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 4<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 5<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 6<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 7<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 8<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 9<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 10<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 11<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 12<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 13<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 14<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 15<\/a><\/li>\r\n\t\t<\/ul>\r\n\t<\/div>\r\n\t<div id="footer">\r\n\t\t<p>Footer<\/p>\r\n\t<\/div>\r\n<\/div>\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n

We are going to break the page up into individual files, and then use PHP includes to join them again. Here is a break down of how the files will be separated.<\/p>\n

\"\"<\/a><\/p>\n

The first step is to is to create a new PHP file. This file will be for the header, so I will name it header.php (you could also name these header.inc if you would like). We will cut all of the code from the beginning HTML tag all the way down to the end of the header section and paste it in this file. The file should look like this:<\/p>\n

\r\n\r\n<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01\/\/EN"\r\n        "http:\/\/www.w3.org\/TR\/html4\/strict.dtd">\r\n<html lang="en">\r\n<head>\r\n\t<title>Simple 2 column CSS layout, final layout | 456 Berea Street<\/title>\r\n\t<meta name="description" content="How to create a simple two column CSS layout with full width header and footer.">\r\n\t<meta name="copyright" content="Copyright (c) 2004 Roger Johansson">\r\n\t<meta name="author" content="Roger Johansson">\r\n\t<style type="text\/css">\r\n\tbody,\r\n\thtml {\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t\tbackground:#a7a09a;\r\n\t\tcolor:#000;\r\n\t}\r\n\tbody {\r\n\t\tmin-width:750px;\r\n\t}\r\n\t#wrap {\r\n\t\tbackground:#99c;\r\n\t\tmargin:0 auto;\r\n\t\twidth:750px;\r\n\t}\r\n\t#header {\r\n\t\tbackground:#ddd;\r\n\t}\r\n\t#header h1 {\r\n    \tpadding:5px;\r\n\t    margin:0;\r\n    }\r\n\t#nav {\r\n\t\tbackground:#c99;\r\n\t\tpadding:5px;\r\n\t}\r\n\t#nav ul{\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t\tlist-style:none;\r\n\t}\r\n\t#nav li{\r\n\t\tdisplay:inline;\r\n\t\tmargin:0;\r\n\t\tpadding:0;\r\n\t}\r\n\t#main {\r\n\t\tbackground:#9c9;\r\n\t\tfloat:left;\r\n\t\twidth:500px;\r\n\t}\r\n\t#main h2, #main h3, #main p {\r\n\t\tpadding:0 10px;\r\n    }\r\n\t#sidebar {\r\n\t\tbackground:#99c;\r\n\t\tfloat:right;\r\n\t\twidth:240px;\r\n\t}\r\n\t#sidebar ul {\r\n\t\tmargin-bottom:0;\r\n    }\r\n    #sidebar h3, #sidebar p {\r\n\t\tpadding:0 10px 0 0;\r\n    }\r\n\t#footer {\r\n\t\tbackground:#cc9;\r\n\t\tclear:both;\r\n\t}\r\n\t#footer p {\r\n\t\tpadding:5px;\r\n\t\tmargin:0;\r\n    }\r\n\t<\/style>\r\n<\/head>\r\n<body>\r\n\r\n<div id="wrap">\r\n\t<div id="header"><h1>Simple 2 column CSS layout, final layout<\/h1><\/div>\r\n<\/pre>\n

Next we will cut the code for the top menu and paste it into a file called top-menu.php<\/p>\n

\r\n\r\n<div id="nav">\r\n\t\t<ul>\r\n\t\t\t<li><a href="#">Option 1<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 2<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 3<\/a><\/li>\r\n\r\n\t\t\t<li><a href="#">Option 4<\/a><\/li>\r\n\t\t\t<li><a href="#">Option 5<\/a><\/li>\r\n\t\t<\/ul>\r\n\t<\/div>\r\n<\/pre>\n

And the last part is to cut from the div id=\u201dsidebar\u201d to the end of the page and paste it in sidebar.php. You could also separate the footer into its own file, but for the is example I will include it into the sidebar.<\/p>\n

\r\n\r\n<div id="sidebar">\r\n\t\t<h3>Column 2<\/h3>\r\n\t\t<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna.<\/p>\r\n\t\t<ul>\r\n\t\t\t<li><a href="#">Link 1<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 2<\/a><\/li>\r\n\r\n\t\t\t<li><a href="#">Link 3<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 4<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 5<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 6<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 7<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 8<\/a><\/li>\r\n\r\n\t\t\t<li><a href="#">Link 9<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 10<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 11<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 12<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 13<\/a><\/li>\r\n\t\t\t<li><a href="#">Link 14<\/a><\/li>\r\n\r\n\t\t\t<li><a href="#">Link 15<\/a><\/li>\r\n\t\t<\/ul>\r\n\t<\/div>\r\n\t<div id="footer">\r\n\t\t<p>Footer<\/p>\r\n\t<\/div>\r\n<\/div>\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n

Now if you cut all of those lines, it should leave you with the following code in your original file:<\/p>\n

\r\n\r\n\t<div id="main">\r\n\t\t<h2>Column 1<\/h2>\r\n\t\t<p><a href="\/">456 Berea Street Home<\/a> | <a href="\/lab\/developing_with_web_standards\/csslayout\/2-col\/">Simple 2 column CSS layout<\/a> | <a href="http:\/\/www.456bereastreet.com\/lab\/developing_with_web_standards\/">Developing with web standards index<\/a><\/p>\r\n\r\n\t\t<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<\/p>\r\n\t\t<p>Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.<\/p>\r\n\t\t<p>Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.<\/p>\r\n\t\t<h3>Consectetuer adipiscing elit<\/h3>\r\n\t\t<p>Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<\/p>\r\n\t\t<p>Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.<\/p>\r\n\r\n\t<\/div>\r\n<\/pre>\n

So now we have all of the code broken down into include files. How do we put them all back together?<\/p>\n

Create a file called template.php, we will use this as the template to build each content page. Now we just have to include the pages we just created. When using include, the web server will render the code from the included pages before the browser interprets it. You will see later that the source code will be identical if viewed in the browser.<\/p>\n

This is what your template.php file should look like:<\/p>\n

\r\n\r\n<?php include('header.php');?>\r\n\r\n<?php include('top-menu.php');?>\r\n\r\n\r\n\t<div id="main">\r\n\t\t<h2>Column 1<\/h2>\r\n\t\t<p><a href="\/">456 Berea Street Home<\/a> | <a href="\/lab\/developing_with_web_standards\/csslayout\/2-col\/">Simple 2 column CSS layout<\/a> | <a href="http:\/\/www.456bereastreet.com\/lab\/developing_with_web_standards\/">Developing with web standards index<\/a><\/p>\r\n\r\n\t\t<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vel magna. Mauris risus nunc, tristique varius, gravida in, lacinia vel, elit. Nam ornare, felis non faucibus molestie, nulla augue adipiscing mauris, a nonummy diam ligula ut risus. Praesent varius. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.<\/p>\r\n\t\t<p>Nulla a lacus. Nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce pulvinar lobortis purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec semper ipsum et urna. Ut consequat neque vitae felis. Suspendisse dapibus, magna quis pulvinar laoreet, dolor neque lacinia arcu, et luctus mi erat vestibulum sem. Mauris faucibus iaculis lacus. Aliquam nec ante in quam sollicitudin congue. Quisque congue egestas elit. Quisque viverra. Donec feugiat elementum est. Etiam vel lorem.<\/p>\r\n\t\t<p>Aenean tempor. Mauris tortor quam, elementum eu, convallis a, semper quis, purus. Cras at tortor in purus tincidunt tristique. In hac habitasse platea dictumst. Ut eu lectus eu metus molestie iaculis. In ornare. Donec at enim vel erat tempor congue. Nullam varius. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla feugiat hendrerit risus. Integer enim velit, gravida id, sollicitudin at, consequat sit amet, leo. Fusce imperdiet condimentum velit. Phasellus nonummy interdum est. Pellentesque quam.<\/p>\r\n\t\t<h3>Consectetuer adipiscing elit<\/h3>\r\n\t\t<p>Nulla dictum. Praesent turpis libero, pretium in, pretium ac, malesuada sed, ligula. Sed a urna eu ipsum luctus faucibus. Curabitur fringilla. Suspendisse sit amet quam. Sed vel pede id libero luctus fermentum. Vestibulum volutpat tempor lectus. Vivamus convallis tempus ante. Nullam adipiscing dui blandit ipsum. Nullam convallis lacus ut quam. Mauris semper elit at ante. Vivamus tristique. Pellentesque pharetra ante at pede. In ultrices arcu vitae purus. In rutrum, erat at mollis consequat, leo massa consequat libero, ac vestibulum libero tellus sed risus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<\/p>\r\n\t\t<p>Maecenas eu velit nec magna venenatis consequat. In neque. Vivamus pellentesque, lacus eu aliquet semper, lorem metus rhoncus metus, a ornare orci ante a diam. Nunc sem nisl, aliquet quis, elementum nec, imperdiet in, wisi. Proin in lorem. Etiam molestie diam eget ante. Morbi quis tortor id lacus mollis venenatis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam vel orci sit amet tellus mollis eleifend. Donec urna diam, viverra eget, ultricies gravida, ultrices eu, erat. Proin vel arcu. Sed diam. Cras hendrerit arcu sed augue. Sed justo felis, luctus a, accumsan in, tincidunt facilisis, libero. Phasellus eu eros.<\/p>\r\n\r\n\t<\/div>\r\n\r\n\r\n\r\n<?php include('sidebar.php');?>\r\n\r\n<\/pre>\n

Then when creating a new file, simple use the template and change the content in the main div to the new content. When you want to add a link to that page you can add it in sidebar.php or top-menu.php<\/p>\n","protected":false},"excerpt":{"rendered":"

So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren\u2019t using PHP includes, you will have to update each file. Wouldn\u2019t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30,24,17],"tags":[164,49,47,48],"yoast_head":"\nSimple PHP Website Templates<\/title>\n<meta name=\"description\" content=\"So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren\u2019t using PHP includes, you will have to update each file. Wouldn\u2019t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Johnathan Ward\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/teamtutorials.com\/#website\",\"url\":\"https:\/\/teamtutorials.com\/\",\"name\":\"Team Tutorials\",\"description\":\"Learn something new today\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/teamtutorials.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/08\/php-templates-1.jpg\",\"contentUrl\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/08\/php-templates-1.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#webpage\",\"url\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates\",\"name\":\"Simple PHP Website Templates\",\"isPartOf\":{\"@id\":\"https:\/\/teamtutorials.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#primaryimage\"},\"datePublished\":\"2008-08-25T17:10:50+00:00\",\"dateModified\":\"2008-08-27T17:10:19+00:00\",\"author\":{\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9\"},\"description\":\"So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren\\u2019t using PHP includes, you will have to update each file. Wouldn\\u2019t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.\",\"breadcrumb\":{\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/teamtutorials.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple PHP Website Templates\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9\",\"name\":\"Johnathan Ward\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r\",\"caption\":\"Johnathan Ward\"},\"description\":\"Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.\",\"sameAs\":[\"http:\/\/johnathanward.com\",\"https:\/\/twitter.com\/spyderman4g63\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Simple PHP Website Templates","description":"So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren\u2019t using PHP includes, you will have to update each file. Wouldn\u2019t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates","twitter_misc":{"Written by":"Johnathan Ward","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/teamtutorials.com\/#website","url":"https:\/\/teamtutorials.com\/","name":"Team Tutorials","description":"Learn something new today","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/teamtutorials.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#primaryimage","inLanguage":"en-US","url":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/08\/php-templates-1.jpg","contentUrl":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/08\/php-templates-1.jpg"},{"@type":"WebPage","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#webpage","url":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates","name":"Simple PHP Website Templates","isPartOf":{"@id":"https:\/\/teamtutorials.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#primaryimage"},"datePublished":"2008-08-25T17:10:50+00:00","dateModified":"2008-08-27T17:10:19+00:00","author":{"@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9"},"description":"So you have a basic HTML site with 100 pages, what happens when you want to change the title tag? Well, if you aren\u2019t using PHP includes, you will have to update each file. Wouldn\u2019t it be nice if you could make the change to one file and it would update every page? That is what we will accomplish with our basic PHP template tutorial.","breadcrumb":{"@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/simple-php-website-templates#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/teamtutorials.com\/"},{"@type":"ListItem","position":2,"name":"Simple PHP Website Templates"}]},{"@type":"Person","@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9","name":"Johnathan Ward","image":{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r","caption":"Johnathan Ward"},"description":"Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.","sameAs":["http:\/\/johnathanward.com","https:\/\/twitter.com\/spyderman4g63"]}]}},"_links":{"self":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1647"}],"collection":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/comments?post=1647"}],"version-history":[{"count":0,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1647\/revisions"}],"wp:attachment":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/media?parent=1647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/categories?post=1647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/tags?post=1647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}