Community Forums › Forums › Archived Forums › General Discussion › Metro-pro functions.php
- This topic has 12 replies, 5 voices, and was last updated 3 years, 6 months ago by Anita.
-
AuthorPosts
-
March 29, 2020 at 4:02 pm #497575tpack33Member
Genesis 3.3.1
Metro-pro theme (fresh download)Default functions.php file generates an error:
Fatal error: Uncaught Error: Call to undefined function get_template_directory() in /home/customer/www/domain/public_html/wp-content/themes/metro-pro/functions.php:14 Stack trace: #0 {main} thrown in /home/customer/www/domain/public_html/wp-content/themes/metro-pro/functions.php on line 14
===functions.php===
// Start the engine.
include_once( get_template_directory() . '/lib/init.php' );===
How to fix it?
March 29, 2020 at 4:18 pm #497576Brad DaltonParticipantMarch 29, 2020 at 4:34 pm #497580tpack33MemberI don't think so, I moved my website to a new hosting server with previous version framework 3.2.1 and my old metro-pro theme (ca 2016). Then downloaded and manually installed the most recent Metro-pro theme and framework 3.3.1. Did some quick customization - everything works as expected.
I then attempted to add php code to functions.php to read custom.css when I noticed that the default functions.php file is generating the error.
Just re-uploaded clean functions.php - the same error
just to be clear - the website running fine, only noticed the error when reviewing php_errorlog file
March 29, 2020 at 4:43 pm #497581Brad DaltonParticipantMarch 29, 2020 at 4:47 pm #497582tpack33MemberJust to be clear - the website running fine, only noticed the error when reviewing php_errorlog file
March 29, 2020 at 5:02 pm #497585tpack33Memberchanged PHP version from 7.316 to 7.013 but didn't help
March 29, 2020 at 5:45 pm #497586AnitaKeymasterDid you by any chance change the name of the theme anywhere?
Love coffee, chocolate and my Bella!
March 29, 2020 at 7:44 pm #497590tpack33MemberNo, I didn't. I downloaded fresh zip package from Studiopress just today and uploaded via FTP to new server simply replacing old Metro theme.
Maybe I should have installed it from WP admin panel?
March 29, 2020 at 8:36 pm #497592tpack33MemberThere was another SG plugin that was generating other unrelated errors due to the upload path of the website being incorrect after website move.
Is it possible that the genesis/metro-pro also getting the upload path incorrectly?
However, don't know where to check that setting
March 30, 2020 at 6:36 am #497597Victor FontModeratorInstall the Kint debugger and activate it. Then to see the path, in functions.php add
d( get_template_directory() );
It will show you on the screen what's happening.
The error you're seeing though "Call to undefined function get_template_directory()" indicates that WordPress isn't fully loaded before the child theme, which is really odd. get_template_directory() is a WordPress function. It should be loaded well before the theme.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?April 1, 2020 at 2:58 pm #497662tpack33MemberKint plugin indicates that get_template_directory() path is pointing to
wp-content/themes/genesis as it should?October 4, 2020 at 12:32 pm #501323wandererParticipantDid you figure this out? I am having the same problem.
October 4, 2020 at 1:09 pm #501326 -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.