Archived topic
Child theme not working after site migration
6 replies · Started by Ashton on October 30, 2017
Hello I just migrated my site from localhost and the child theme won't work it says it needs the parent theme installed, but I've reinstalled the parent theme half-a-dozen times and it still won't work
Here is what my functions.php file looks like:
*/
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'generate-style' for the GeneratePress theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
/*
Hi there,
Does this help? https://docs.generatepress.com/article/child-theme-issues/#enqueing-the-parent-style-css-file
It didn't, I'm not exactly sure what should be in that document after removing code that looks like the one mentioned in that article.
What if you just use a blank one from here? https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme
Yes, I will copy the custom coding into this thank you!
No problem!