roscfi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Problem Getting Child Theme Functions.php Right@oscarguy any news?
Forum: Fixing WordPress
In reply to: Problem Getting Child Theme Functions.php RightYou’re calling a function twice with the add action.
<?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' ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() {...
And I think that’s not going to works well.
Try to replace the code you have in your functions.php for:<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parent_style = 'frontier-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') ); }
Forum: Fixing WordPress
In reply to: Problem Getting Child Theme Functions.php RightI’ve take a look in the Child Theme page of WordPress and at a child theme I’ve created. I think you should put the string “frontier-style” as it says in the comment after the $parent_style variable for the Twenty Fifteen Theme. I let my child-style as it is in the code in the Child Theme WordPress page.
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parent_style = '<strong>frontier-style</strong>'; // 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') ); }
- This reply was modified 5 years, 6 months ago by roscfi. Reason: Make it clearly
Forum: Fixing WordPress
In reply to: Problem Getting Child Theme Functions.php RightPlease, take a look in your browser inspector and see in the network tab what is the state of the style.css, if there is a style.css with status 404, try to activate another theme and then activate again your child-theme.
Forum: Fixing WordPress
In reply to: Problem Getting Child Theme Functions.php RightHey guy! What are you trying to do? A child Theme?