Hello I wanted to know if I could use a php include for the head of my site. I want to keep it clean and not have unnecessary junk in pages that don’t need it (for example if I don’t need to have jquery in that particular page).
And I want to be able to change all the pages at once. I’m doing it with the sidebar/ footer right now.
Let me know if I should explain more… thank you for your time.
Then when I want a new page, I start a new file and it looks like:
$title = "xxx"; // this is for <title>
$page_title = "xxx"; //this is for breadcrumbs if I want a custom title other than the default
$addCSS = ""; //custom CSS for this page only
//start typing html/body text here
You are welcome. I was getting tired of opening a file, copying, going back and making a new file, pasting, removing the content, typing in the new content, save, tweak. Now here’s my title, grab the header, type body, grab the footer. On my to do is make a flag, so if wide is true, don’t grab the menu (within header) and set the content holder to the width of my container. It would probably take 30 minutes to do, so some day.
I started off like you Ryan but now have a switch in the header which also contains the navigation information. Add a new page save the info into the switch statement and you are done - new button created automaticaly but only realy works for smaller sites.
I also have an include for the footer so my page is include header - content - include footer.
It would be worth it to do now, before you add stuff on top of it. That’s what I’m doing and I have to keep going back and fourth. I want to nip it in the bud, though so I don’t have to when my website has more pages. I just want everything to be perfect and organized. I don’t know what a “flag” is, but i’m going to, lol.