Probably a silly one but hopefully someone has encountered this before.
The problem:
I have a local copy of my Wordpress site that works fine and a copy on the server. After uploading I get Call to undefined function
from within the child theme's header.php
referencing a function that should exist in its parent theme.
Full error message:
Fatal error: Call to undefined function shapely_get_header_logo() in /home/twimp/training.twimp.co.uk/wp-content/themes/shapely-child/header.php on line 33
Background:
The server has recently had a Wordpress site running on it fine so I don't have particular reason to think its anything related to its configuration.
I'm using a different theme from the last time it was uploaded so I started by uploading these two directories, my child theme and its parent. A lot of changes had been made with the plugins so I cleared the plugins directory and re-uploaded everything.
I also completely wiped the database and imported from local and then modified the options table to put the correct server url back in.
wp_config has not been touched and so it still points at the right database.
What I've tried:
I initially thought that maybe a file or two hadn't uploaded so I checked the FTP server side by side, starting with the files it should have been looking at. They all seem to be there.
I thought perhaps it was a file permission problem so I reset all of the files in the wp_content directory.
Just in case I was losing my mind, I have tried making small changes to the header.php
just to confirm it is in fact the right file on the right server and the database is looking at the right files. All normal.
I tried commenting out the erroneous function call but all that did was move the error down to the next function called.
I checked the style.css
to check its parent declaration was correct. I noticed there is a difference in file size between server and local but I've downloaded the file and it looks correct.
I modified the functions.php
on both parent and child simply to var_dump
the current user. The child theme printed, the parent theme did not.
Conclusion: It seems as if my child theme is not aware of its parent when on the server but I can't figure out why that might be.
Child theme style.css
/*
Theme Name: Shapely Child
Template: Shapely
Version: 1.1.7
Author: colorlib
Author URI: LINK
*/
Parent theme style.css
/*
Theme Name: Shapely
Theme URI: LINK
Author: colorlib
Author URI: LINK
...
*/
I apologise in advance if I've skipped over anything essential.
Any and all help is greatly appreciated.
style.css
so we can check everything needed to do a child theme has been put in place correctly – Tom J Nowell♦ Aug 25 '17 at 11:04