I created a fresh new installation of WordPress, copied both Base and Base Child themes and activated Base Child. The Appearance/Customize gives the same white screen as described in point 1 below.
I then activated Base and the Appearance/Customize screen has the same error, which did not occur on the previous WP installation. This leads me to believe I have an issue with my customizer code. I WILL get to the bottom of this.
I developed a custom theme, let's call it "Base", based on https://underscores.me/, which is the boilerplate for several other child themes. The Base theme features several theme mods accessible via the theme customizer. I also created a child theme of Base, A.K.A. "Base Child", right now containing only the style.css file, which is copied below:
/* Theme Name: Base Child Template: base Theme URI: https://blabla.com/ Author: Me Author URI: https://blabla.com/ Description: Base Child Version: 1.0.0 Text Domain: base-child Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready */
The only plugins installed are:
- ACF Photo Gallery Field
- Advanced Custom Fields (the free version)
- Simple Page Ordering
Everything works fine when the Base theme is activated, meaning all custom post types are there, the theme customizer works perfectly, all shortcodes behave like they should etc.
Things can be very confusing from now on, so please be patient with me. As soon as I activate Base Child, weird things start to happen:
- If I go to Appearance/Customize, I get a screen showing only the "You are customizing Site Name" message and the page title is "Customizing: Loading..." forever. Nothing else works.
- Related to point 1, a console inspection reveals this JS error on the page:
Uncaught SyntaxError: Unexpected token '<' on customize.php on line 5240, and when looking at the page source, I'm finding what looks like a php error:
Warning: sprintf(): Too few arguments in C:\wamp64\www\base-boilerplate\wp-includes\theme.php on line <i>1027</i>
- Trying to replicate this issue with another theme, I installed Twenty Twenty and declared Base Child to be a child of Twenty Twenty in its
style.css. I was amazed to see that all the custom post types created in Base were present in Base Child as a Twenty Twenty child. Going to Appearance/Customize, I get the same behavior as at point 1. It's as if Base Child was still a child of Base.
- Clearing the browser cache has no effect on point 3.
- Opening WP Admin in another browser not used before has no effect on point 3.
- Activating Twenty Twenty and then activating Base Child (still as a child of Twenty Twenty) makes Base Child behave like a real child of Twenty Twenty. No more custom post types and Appearance/Customize works as expected. At this point, Base Child is activated.
- Declared Base Child as a child of Base in its
style.css. Went to the browser and it looks like Base Child is still a child of Twenty Twenty. No custom post types, no Appearance/Customize issues.
- Activate Base, then activate Base Child as a child of Base: CPTs of Base appear, Appearance/Customize ceases to work as described in point 1.
I'm baffled. Looked everywhere, tried everything, nothing helped. It seems WP has a cache of its own, database related perhaps, otherwise I can't explain why the CPTs remain when I switch themes. It has nothing to do with browser cache.