• Hello,
    I’m creating a template on my local machine using xampp for the latest WordPress version. I have created an index.php which works just fine. I’m also trying to create a archive.php page that’s just a simple list. But that page is unable to access any of the php commands. For example for the header, I’ve tried <?php get_header(); ?> and also <?php include (TEMPLATEPATH.'/header.php'); ?>. The first gives me a “Fatal error” and the other gives me “Warning.” I’ve tried creating multiple other .php files (in the same template folder) but none can access any of the php attributes other than index.php. <?php wp_get_archives(); ?>, doesn’t work either, not does <?php get_footer(); ?>, none of them. I’m not sure what’s wrong.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Don’t call it directly. Put it in the theme.

    https://codex.www.ads-software.com/Theme_Development

    Thread Starter drchocolicious

    (@drchocolicious)

    Ah, I think I see what you mean. Whatever is clicked on the index.php page, it uses the appropriate template page to display it. Like if I were to click on an Archive Month on the Sidebar.

    But here is the thing. I don’t have a sidebar, nor do I want to make one. It’s a single column page. My plan is to make a “Search” page, the link being in the nav in the header.php file. It will have a search function. and have Archives listed by category and time. So I guess what I’m asking is how do I call it from the my navigation that’s in the header file, so that it uses the page as an particular template.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Understand the Template Hierarchy.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get_header() problem’ is closed to new replies.