Quick heads up, I know nothing much about php so I might need some extra help with this. So, I have set up a while ago a child theme for Astra in Wordpress. And while everything is working well so far, I just noticed that the customizer preview page is not working, or rather not fully loading at all.
I went through the whole plugins deactivation stuff, but it didn't change anything, so when I switched to my parent theme, I noticed the customizer works. Meaning that the problem is from my child theme.
I'll put below what I have in both the style.css and functions.php files of my child theme, please do let me know if something is wrong.
/*
Theme Name: X Child Theme // Made by Y
Author: Y
Description:
Template: astra
*/
Functions.php files
<?php
function astra_child_enqueue_parent_theme_style() {
// Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme)
$theme = wp_get_theme( 'astra' );
$version = $theme->get( 'Version' );
// Load the stylesheet
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css', array(), $version );
}
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_parent_theme_style' );
?>
Thoughts?
Edit: My bad, I actually meant to write template there. It is declared as Templare: in the style.css file. and the comment blocks are there as well. I will edit it my post to fix it. Thanks a lot anyway
add_action('wp_head', function(){
? Is that really the last line of your functions file?