WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] why start content div in header? (6 posts)

  1. shortajay
    Member
    Posted 6 years ago #

    So I am a n00b and was wondering why people start content divs in the header php file and end them in the footer? I'm looking at several template themes and it doesn't make sense to me. Why wouldn't one just start and end a div within the file it's being used in (e.g. start and end the content div within the index.php file)?

  2. Kwebble
    Member
    Posted 6 years ago #

    If the tags are in the header and footer you don't need to duplicate them in every template file. This makes them easier to find and maintain if a change to the HTML structure of the site is needed.

  3. robbart
    Member
    Posted 6 years ago #

    In addition, if the div is intended to surround the page content, it needs to start in one file (header.php) and end in another (footer.php).

  4. shortajay
    Member
    Posted 6 years ago #

    i do understand that there is a need not to duplicate divs. but i don't understand why content divs are made to surround the page content. the ones i'm looking at don't surround the page content -- they constitute the page content. yet for whatever reason, people start and end them in the header and footer files. no formatting in the CSS would change how it displays, and none of it affects the header or footer.

  5. Root
    Member
    Posted 6 years ago #

    This doesn't matter in the least. In your own themes do your own thing. I am with the OP. Its nonsense. It started in Kubrick.

  6. shortajay
    Member
    Posted 6 years ago #

    thanks root!

Topic Closed

This topic has been closed to new replies.

About this Topic