[resolved] Do i need a header.php / footer.php (4 posts)

  1. CharlieWaffles
    Posted 5 years ago #

    Is there any real need to create a separate header.php / footer.php when making an own wordpress theme, or can i leave all markup in the index.php?

  2. vijayrajesh
    Posted 5 years ago #


    That is really a great question. It means you are progressing in theme concept :)

    Well, I think we need those files really. Because, when page.php file called in wp theme, index.php file may not be called. So at that time, footer.php may be required.

    Correct me if i am wrong.

    Thank you,

  3. CharlieWaffles
    Posted 5 years ago #

    ok, didnt think about this issue.

  4. pdxchambers
    Posted 5 years ago #

    You don't explicitly need to separate them out but you would need to make sure that all template files have the proper header and footer code in them. That would mean essentially duplicating work for at least index.php, single.php, page.php, and search.php (not to mention any custom template files). Personally, I think it's much easier to separate them out and then call get_header() and get_footer().

Topic Closed

This topic has been closed to new replies.

About this Topic