Should I use PHP for header and footer?

Discussion in 'Web Design' started by Elect, Jan 19, 2013.

to remove all ads.
  1. Elect

    Elect New Member

    Messages:
    9
    I don't know if it's spam or not. The way I see it, it is a way to let people know that I work in their town. If there is a better way to do that, I am all ears, and I am not being sarcastic when I say that. I work in about 15 towns and I would like the best way to let people know that and have my company website come up when they search for an electrician in my town.
     
  2. Frank

    Frank New Member

    Messages:
    117
    That was not the question. The question was *how* to use includes. Do you use one file with a head, header, nav, side and footer over and over again, and include a new article for every new page, or do you give each article file a head, and include the header, nav, side and footer.

    To be able to give each page a different <title> and meta description, you should use the latter method.
     
    Last edited: Jan 23, 2013
  3. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    So why did YOU bring SEO into the thread?

     
  4. AsheSkyler

    AsheSkyler New Member

    Messages:
    177
    Since SEO is up, I gotta 'nother question. Would it be a good idea for Elect to reupload all the old .html files but with a 301 permanent redirect in each pointing to their corresponding .php replacements?

    Now I need to go back and rethink my footer navigation too. I always assumed the reason why other sites did that was to make it easier for visitors when the page was long, just like how some simply have a "return to top" link, and the reason that sites like MySpace had all that extra junk in the footer was because they were trying to be even more helpful because their site was so big and complex. But it seems footer navigation makes you look shady to the crawlers. Quite honestly, the only time I was ever concerned about SEO was when I found out search engines grabbed random content from my site for the little blurb under the link on the results page. My only focus then was to have a proper description tag so it'd make more sense to what 3-5 people ever search for it.

    You can still have unique titles, descriptions, meta keywords, and anything else by using echoes on the template file and assigning a value to the corresponding $thingies on the body file before "include template". No different than how echoing $content works.
    It's just a matter of which way your lazy falls. You can use quite a few files and avoid the apostrophe/quote problem, or you can only worry about two files (three, counting the stylesheet) per page but watch your apostrophes and quote marks. Contact forms with PHP involved get mighty interesting the second way.

    (I know it's hard to take somebody serious who uses words like "thingie". Just go with it. :p )
     
  5. Elect

    Elect New Member

    Messages:
    9
    A 301 redirect goes in the .htaccess file. The old pages aren't required to still be there.
     
  6. Frank

    Frank New Member

    Messages:
    117
    Because SEO has everything to do with giving each page its own <title> and description, and I didn't understand then that AsheSkyler did that, too (see the below message).
     
    Last edited: Jan 24, 2013
  7. Frank

    Frank New Member

    Messages:
    117
    Only now do I see that you, too, gave each page its own title and description. Upon first reading your first message, I missed this sentence or it didn't sink in:

    My apologies. Still, I would prefer the traditional method, because in your method the content text all gets one color in the code editor. I like the code coloring feature most code editors have nowadays. But it is always good to have two options; under certain circumstances, yours might well be my method of choice, too.
     
    Last edited: Jan 24, 2013
  8. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    No it hasn't, certainly it is useful if documents do have unique content in the title element. But it is NOT "everything".

    Same with the content attribute of the document meta description element, it doesn't have to even be filled in, never mind be "different"
     
  9. Frank

    Frank New Member

    Messages:
    117
    Don't put words in my mouth that I didn't use. I didn't say it *was* everything. I said it has everything to do with.

    It indeed doesn't, but it sure helps. Assuming equal numbers of external links to the three sites, the site with the search term in the title will come out on top, the one with the search term in the meta description tag will come out second, the other one third.
     
  10. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    If it were that simple.

    The meta description content is NOT used for anything other than the text snippet, should Google decide to actually use it.

    Words in the meta description are NOT used by Google for search term weighting.
     
  11. Elect

    Elect New Member

    Messages:
    9
    Are you sure about that? A lot of people have told me differently.
     
  12. Frank

    Frank New Member

    Messages:
    117
  13. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    Yes, there are plenty of "experts" talking all kind of bollocks!!!!

    It's simple enough to test, invent a word make sure there are no results, put it in the meta description content ONLY, see if it appears in the index.
     
  14. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    Yes that's called a "text snippet" and Google MIGHT show the meta description content as the snippet or they may not.

    But it DOESN'T mean it is used for search term weighting in the results.
     
  15. AsheSkyler

    AsheSkyler New Member

    Messages:
    177
    No worries, man. Two files are simpler for the most part, and probably should be recommended for most people. Since I guinea pig my site often, it's just easier for me to assign different values on one file (like the stats for a story's character bios) and then go crazy with the placement on the main file.

    And, yeah, I agree that color thing gets annoying if you have a lot of tags or comments to keep track of besides the break and paragraph tags.
     
  16. Frank

    Frank New Member

    Messages:
    117
    That's cheating, because you know all too well that text in a description tag must also be in the article for Google to do something with it.

    I don't give a rat's ass what exactly Google uses it for. If Google itself advises to include a proper description, people should do that. End of story.
     
  17. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,611
    Thereby proving that it does not help with "ranking" which is what your post suggested.
     
  18. Frank

    Frank New Member

    Messages:
    117
    No, it doesn't prove that at all. What this does prove, however, is that you (only) read what you want to read, not what is written, or only part of it. I already said that I don't give a rat's ass what exactly Google uses it for. They advise, we should do it. End of story. And end of discussion.
     
    Last edited: Jan 25, 2013

Share This Page