134 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
+3 more
ConnorTurnbull says

Hi, Is it bad to use PHP includes on a ordinary site template. For example, I have a site with a few different page templates but the header and footer is included so for each template its:

<?php include('header.php'); ?>
PAGE TEMPLATE
<?php include('footer.php'); ?>

Bad or nothing to worry about?

367 posts
  • Has been part of the Envato Community for over 5 years
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
  • Located in Denmark
+1 more
UI20 says

Hmmm What do you mean ordinary templates.

Well it may be a bit harder for some people to edit if they aren’t used to PHP but using includes is like the most fundamental thing in PHP so maybe it is fine. Certainly easier to update an included header if it repeats on multiple pages.

568 posts Themes and Graphics
  • Has been part of the Envato Community for over 5 years
  • Has referred 50+ members
  • Has sold $250,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 more
Bebel says

When we are working on a website template, we first start with the php version, like you did. Some basic includes to simplify development. But as HTML is required, too, especially for those who don’t use php (python, ruby, or even.. plain HTML !!), it’s a pain in the ass to get rid of php.

So basically all we do is to load the page in the browser, get the source, create a new file and paste it in there. All you have left to do is some search’n replace stuff for things like pathes and links (.php => .html).

95 posts
  • Has referred 10+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
bringthepixel says
When we are working on a website template, we first start with the php version, like you did. Some basic includes to simplify development. But as HTML is required, too, especially for those who don’t use php (python, ruby, or even.. plain HTML !!), it’s a pain in the ass to get rid of php. So basically all we do is to load the page in the browser, get the source, create a new file and paste it in there. All you have left to do is some search’n replace stuff for things like pathes and links (.php => .html).

Same here. Working on the HTML version from the very beginning would be a maintenance nightmare

367 posts
  • Has been part of the Envato Community for over 5 years
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
  • Located in Denmark
+1 more
UI20 says
When we are working on a website template, we first start with the php version, like you did. Some basic includes to simplify development. But as HTML is required, too, especially for those who don’t use php (python, ruby, or even.. plain HTML !!), it’s a pain in the ass to get rid of php. So basically all we do is to load the page in the browser, get the source, create a new file and paste it in there. All you have left to do is some search’n replace stuff for things like pathes and links (.php => .html).

Thats a nice way opf doing it but I wonder if there is a way to do it that doesn’t mess up the non includes. But I guess its not a big deal to reimplement the other php.

by
by
by
by
by
by