Php Fatal Error Call To Undefined Function Get_header In
Contents |
Troubleshooting » [Resolved] Error: Call to undefined function get_header() in child theme [Resolved] Error: Call to undefined function get_header() in child theme straussy @straussy 8 months, 3 weeks ago Hello, I am working on a child theme from _tk and am getting the following how to fix the php fatal error call to undefined function get_header() error in wordpress error message when I click on the home link in the navbar. I have created call to undefined function get_header() in index.php on line 14 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 fatal error: call to undefined function 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
Get_header Wordpress
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) jc62 @jc62 8 months, 3 weeks ago 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. straussy @straussy 8 months, 3 weeks ago include in php 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. jc62 @jc62 8 months, 3 weeks ago 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)" ? straussy @straussy 8 months, 3 weeks ago 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 swit
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss download wordpress the workings and policies of this site About Us Learn more about
Install Wordpress
Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow
Localhost/phpmyadmin
Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each https://wordpress.org/support/topic/error-call-to-undefined-function-get_header-in-child-theme/ other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function get_header() up vote 1 down vote favorite I am using this code to go to a page. In my directory there is theme folder ch.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://stackoverflow.com/questions/25979528/fatal-error-call-to-undefined-function-get-header-in-c-xampp-htdocs-hypersho Overflow the company Business Learn more about hiring developers or posting ads with us http://wordpress.stackexchange.com/questions/98414/call-to-undefined-function-get-header-in-index-php Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hypershot\index.php on line 13 up vote 0 down call to vote favorite I have just purchased a wordpress template and i am trying to run this theme locally (xampp), and then when the site loads, it gives me the following error: —> Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hypershot\index.php on line 13 I want to know how to proceed...Any tips ?? ps. Im really sad about it now, as i tought it was going to be easy to deal call to undefined with this template/theme ! I just can´t run the site (Local). wordpress xampp share|improve this question asked Sep 22 '14 at 17:09 Rodrigo Lacerda 111 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote The error is: Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hypershot\index.php According to WordPress folder structure the index.php file in the root of your project should be something like this (Version - 4.0): /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); But the error says that, you have an index.php file which has get_header() function (WordPress function) inside it, so this index.php file belongs to root of your theme folder not inside the root of your project folder. Since the get_header() is a WordPress function and WordPress is not loaded yet so PHP is throwing this error because it doesn't recognize the get_header() function. So check the index.php file in your project's root and make
tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us WordPress Development Questions Tags Users Badges Unanswered Ask Question _ WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Call to undefined function get_header() in index.php up vote 2 down vote favorite I am trying to create a theme. I created a header.php file and call this file in index.php using When I try to run my index.php file it shows this error: Call to undefined function get_header() What could be wrong? errors headers share|improve this question edited May 5 '13 at 17:30 Johannes Pille 8,18031633 asked May 5 '13 at 17:06 Ambika Sharma 1112 Show here your header.php code and index.php code –Piyush Dhanotiya Feb 25 at 13:31 How you tried to "run" that index.php file ....... ?? Did you made a style.css in the theme folder and tried to activate the theme from dashboard ?? –Anoop D Feb 25 at 14:18 Did you created an index.php inside the theme folder ? If not then please see the answer by Rarst ...... –Anoop D Feb 25 at 14:28 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote Generally this happens when someone has mistakenly put index.php from a theme in the WP install folder, where it overwrites the index.php that is the main WordPress file. Download WordPress again, and take the one file, index.php from its root folder, replacing the file you now have as index.php source share|improve this answer answered