Problem Getting Child Theme Functions.php Right
-
I have not gone live yet because I don’t want my site to go down, but I went to the wordpress.org site to get info on how to create a stylesheet and I think there might be errors in the displayed enqueuing code.
Here’s what it shows:
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } ?>It then follows with:
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen 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') ); } ?>I’m pretty sure I need to replace the > with >, but I don’t think that’s the only problem as the editor I’m using says that the & in & is incorrect. Can someone help me confirm all of the sections I need to replace in this one and advise if someone can go to the website and fix that so that others don’t get the wrong information?
The topic ‘Problem Getting Child Theme Functions.php Right’ is closed to new replies.