| |||||||
This is a discussion on what a useful piece of coding! within the Website Discussion forums, part of the Websites category; I imagine this is something that you heavy coders will find ever so basic, but for those of you that ...
![]() |
| | Thread Tools |
| | #1 |
| iPod 60gb | what a useful piece of coding!I imagine this is something that you heavy coders will find ever so basic, but for those of you that have pieced together a very basic knowledge of html, take a look at this: Digital Web Magazine - Easy-peasy PHP 2 It allows you to have one file that is, for example, a footer. You then put a piece of code on every page you want the footer in. This way, if you find later down the line you want to change the footer, it's easy! |
|
| | #2 |
| Super Moderator | Re: what a useful piece of coding!Nice, I'll have a look when on the computer. So am I right in saying (coz can't see it on phone) that if you edit, eg the footer, it changes it on every page? Also is it a simple piece of HTML or is it something only WP and DW users can use? Thanks! (rep when on comp, tapatalk is so limited, can't rep or thank!)
__________________ 2011 Winner of Best Site Award and Grammanazi Award. Runner up for Member of the Year 2011 Spoiler Free iPhone | Free iPhone | Free iPhone 4S | Sign Define App | Freebie Proof Photo Blog ![]() Total Received: £4,218.94 plus Current Stats: 117 green 21 pending Spoiler |
|
| | #3 |
| Mini Mac | Basically it is the way most php based CMS programs such as wordpress work. You have individual files such as header.php, footer.php, mainbody.php then your basic page layout in the actual pages files will just have references to those files. If you need to change your header on every page you simply edit the header.php if you want to change the footer you edit the footer.php and so on
__________________ |
|
| | #4 |
| iPod 60gb Join Date: Nov 2007 Location: Reading
Posts: 1,701
![]() ![]() | This will be useful. Ta pal
__________________ |
|
| | #5 |
| iPod 60gb | No problem guys! I had a couple hiccups getting it totally working, so if any of you guys decides you want to use it and are stuggling, don't hesitate to hit me up. |
|
| | #6 |
| iBook Join Date: Oct 2007 Location: Glasgow
Posts: 2,266
![]() ![]() ![]() | Thanks for pointing this out, it'll be useful for those that haven't tried it yet. I use this method on quite a few of my sites, as it means you can do things like header, footer, and sidebar just the once, and then you don't need them in every page file. You can also use it for menus in some cases
__________________ Received about £1600 worth so far! Spoiler |
|
| | #7 |
| iPod 20gb Join Date: Jun 2008
Posts: 401
![]() | php all the way |
|
![]() |
| Thread Tools | |
| |