• Im getting an Call to undefined function get_header() error when i click on my navigation button which i have tried to set up to link to another template page.

    Ive read other forum topics on this error and they all say to make sure the index in the root isnt the same as the one in my theme and it isnt. ive also deleted the wordpress folder and put in another original wordpress folder into my xampp htdocs folder.

    Anyone have any ideas? My homepage comes up, but for some reason the url show http:localhost:8080/wordpress/

    even though my index file is in my themes folder?

    wordpress/wp-content/themes/mytheme/index.php

Viewing 8 replies - 1 through 8 (of 8 total)
  • Anyone have any ideas? My homepage comes up, but for some reason the url show http:localhost:8080/wordpress/

    even though my index file is in my themes folder?

    wordpress/wp-content/themes/mytheme/index.php

    Yes. That is how it is supposed to work. Strictly speaking the site loads the index.php file at http://localhost:8080/wordpress/index.php, and that file loads everything else. If you are using the default permalinks you can see that that is the case. If you are using pretty permalinks WordPress and Apache conspire to lie about the directory structure of the site. 🙂

    Im getting an Call to undefined function get_header() error when i click on my navigation button which i have tried to set up to link to another template page.

    What does this mean? It sounds important. Exactly what did you do? Post code to the pastebin if applicable.

    Thread Starter marcweissdesign

    (@marcweissdesign)

    all ive done is download wordpress from wordpress.org put it in the htdocs folder in my xampp folder. Then i created a new folder in my themes folder. The only file ive edited was the wp-config file to enter my local database details. Ive checked the index in the root and it is the original one. (many people have said that the accidently pasted their themes index into the root.) My root is fine so dont know why the error comes up.

    Although i have found that once i create my 2 pages Home and News pages in wordpress, and apply my two static page designs to them, and i try linking to the other permalink via my html navigation. Once my new button is clicked for some reason it reverts to my index page. and then if i click it again it goes to my news page, as if the root index loads and then once my link is clicked for some reason goes to my home page again and then if i click on news it goes to the news page. :S odd!

    My themes folder contains a style.css functions.php index.php header.php and footer.php….and its not a child theme so there shouldnt be any conflict with a parent theme.

    Thread Starter marcweissdesign

    (@marcweissdesign)

    im thinking that my index.php loads as if from the root, and then the Home page which holds the same template is acting as a second page rather than opening as the default page. So maybe the index.php file is loaded twice and thats giving the:

    get_header() error

    So, your htdocs folder looks like this:

    htdocs
    –wp-admin
    –wp-includes
    –wp-content
    —-at-least-one-of-the-default-themes
    —-yourtheme
    ——style.css
    ——header.php
    ——index.php
    ——footer.php
    –wp-config.php
    –twenty or so other WordPress php files

    There is nothing else anywhere?

    What does this mean?

    and apply my two static page designs to them, and i try linking to the other permalink via my html navigation.

    How do you “apply your static page designs”? There aren’t any specialized templates.

    Thread Starter marcweissdesign

    (@marcweissdesign)

    my whole root goes like this

    wordpress/wp-content/themes/a bunch of themes and my theme folder/ all my theme files.

    e.g. http:localhost:8080/wordpress/wp-content/themes/mytheme/index.php

    How do you “apply your static page designs”? There aren’t any specialized templates.

    I added the template name to my index.php and my news.php page and created a home and news page on wordpress admin and selected those pages. By doing so i think its loading my index automatically and then its duplicated my index file as well when i put it as my home page template.

    I added the template name to my index.php and my news.php page and created a home and news page on wordpress admin and selected those pages.

    If I understand you, this is wrong. Don’t add a template name to the index.php file. Copy the index.php with a different name, add the Template name part to that copy, and edit that copy. You will need to copy the index.php file once for each of the specialized Templates you want to make.

    Thread Starter marcweissdesign

    (@marcweissdesign)

    ok so your saying that my index.php will be automatically loaded as the first page and that i dnt need to set it as a page in wordpress? So should i only add templates to my other static pages?

    Thanks for your help

    Yes, the index.php file is loaded ‘auto-magically’, as are a number of other files. You don’t always have to name and assign a template. Sometimes the file name itself, if chosen correctly, is enough.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Call to undefined function get_header() error’ is closed to new replies.