• Resolved straussy

    (@straussy)


    Hello,

    I am working on a child theme from _tk and am getting the following error message when I click on the home link in the navbar. I have created a new header.php file in the child theme to override the parent one.

    Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\mysite\wordpress\wp-content\themes\_tk-child\home.php on line 8

    The theme uses the wp-bootstrap-navwalker class and the code is here:http://pastebin.com/68Ummx30

    When I activate the parent _tk theme, change menu link and click on home, the error message does not appear but instead, it take me to the Xampp local server page.

    Any help with this would be much appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Did you create a full child theme as specified in codex ? (Link Here) Generally, you would not simply override the child functions, but you would create additions that would enhance the parent themes.

    Thread Starter straussy

    (@straussy)

    Thanks for your reply.

    Yes I have followed codex when creating the child theme.

    I also tested it with the parent theme and got the same error message.

    I have since done a fresh install of WordPress in case it was a problem with that.

    I was putting the child theme back together and debugging along the way. Once I had added the home page to the menu and tried the link, I got the same error message.

    I downloaded the _tk-master theme, installed in a test server environment. I then reviewed the code in pastebin.com/… as you provided, and found that the code is the same as found in _tk-master theme. It appears you did not change anything… I then added a page & then modified the navbar to open the page created. I then clicked on the menu item, and the link worked as expected without error. My environment is using Desktop Server Premium v3.8.1. Just wondering if the issue is related to apache configuration, or a “wordpress address (URL)”, or “Site Address (URL)” ?

    Thread Starter straussy

    (@straussy)

    Thank you so much for your help jc62.

    You are right, I didn’t change the wp_nav_menu() code at all. I just changed other code in the header.

    Ok, I switched to the _tk-master theme, changed the menu custom links in the dashboard but when I click on the home link I get the 404 page not found message. In the debug log it is the same get_header() error as before.

    I am using apache on xampp. I get a php error message and a warning like this:
    http://pastebin.com/nNdMHJzC

    How could I rule out a wordpress address url or site address url error?

    Thread Starter straussy

    (@straussy)

    Just found the answer to the last question.

    In the settings section, both wordpress address url and site address url are set to http:/localhost/mysite/wordpress.

    Thread Starter straussy

    (@straussy)

    It turned out that the error was with a url in the custom link in the menu. I had put the full url in where it was not needed.

    So, thanks for the help sorting this out.

    Thanks for the update, glad it all worked out.

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

The topic ‘Error: Call to undefined function get_header() in child theme’ is closed to new replies.