Problem setting up child theme
-
I am trying to create a child theme for the Advance Automobile free theme. When I choose “Live Preview” for my child theme, I get the error: “There has been a critical error on this website. Please check your site admin email inbox for instructions.”
My style.css file starts out:
/* Theme Name: Dave's Automotive Author: Ada Kerman Author URI: https://www.davesautoent.com/ Description: Dave's Automotive, child theme of Advance Automobile for Dave's Automotive Enterprises of Marlborough, NH. Version: 0.1 License: GPLv3.0 or later License URI: http://www.gnu.org/licenses/gps-3.0.html Text Domain: davesauto Template: advance-automobile */after which it’s the same as the parent theme style.css file.
My functions.php file is:
<?php // makes sure we don't expose any info if called directly if ( !function_exists( 'add-action' ) ) { echo 'Hi there! I'm just a plugin, not much I can do when called directly.'; exit; } add_action( 'wp_enqueue_scripts', 'davesauto_enqueue_styles' ); function davesauto_enqueue_styles() { $advance-automobile = 'advance-automobile'; $theme = wp_get_theme(); wp_enqueue_style( $advance-automobile, get_template_directory_uri() . '/style.css', array(), // if the parent theme code has a dependency, copy it to here $theme->parent()->get('Version') ); wp_enqueue_style( 'davesauto', get_stylesheet_uri(), array( 'advance-automobile' ), wp_get_theme()->get('Version') // this only works if you have Version in the style header }; } ?>- This topic was modified 4 years, 2 months ago by . Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
- This topic was modified 4 years, 2 months ago by . Reason: Formatting
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Problem setting up child theme’ is closed to new replies.