Plugin Support
Jamie
(@codente)
Hi George,
Sorry you are having trouble. When you say it’s the same child theme, do you mean it’s the exact same child theme? The child theme folder names are the exact same?
-
This reply was modified 1 year, 2 months ago by
Jamie.
Thread Starter
George
(@quantum_leap)
Yes, folder names are exactly the same.
Thread Starter
George
(@quantum_leap)
I noticed something that can be of help. When exporting from the child theme, I can see from the exported file’s code that there are 4 spaces that have been added to the exported file. This thing does not happen when exporting from the parent theme. When removing those spaces from the file, save the file and re import, the import to the other site’s child theme seems to be working now.
Are the same 4 spaces visible when you view the HTML source of the original site and child theme?
Plugin Support
Jamie
(@codente)
That definitely may be a clue. Can you share the URL of the site you are exporting from?
Thread Starter
George
(@quantum_leap)
I am working locally for the time being, but I have pin pointed the issue even though I am still not sure why this is happening! In my child theme’s functions.php file, I am including a PHP script to prompt the use to install the “One Click Demo Import” plugin. User can then install and activate the plugin automatically.
I am including the script like this from my child theme:
require_once get_stylesheet_directory() . '/plugin-installer.php';
If I remove this entry, the export does not add the extra spaces! That’s so weird!
Thread Starter
George
(@quantum_leap)
Ok, that was it. The PHP file’s code I mentioned was 4 spaced indented, meaning there were 4 spaces (a tab click probably) in each line. Removing that fixed the issue. Question is, why did this affect the export?
Question is, why did this affect the export?
Basically those extra spaces would be added to every single thing PHP does on your site, every single page (including admin pages) will have those spaces and any file created by PHP will also have those spaces, thats why the exported file has them.
I made a change to the plugin today that strips any whitespaces suring import, so you should not see the issue now.
Thread Starter
George
(@quantum_leap)
Awesome, thanks for your help!