rnbronstein
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Fruitful] Responsive css loading before child themeDerp. Because I only pasted part of it and didn’t include that massive wall describing the rest of the mobile style with the dropdown menu and all. So I tried adding this in to my child theme:
add_action(‘fruitful_get_responsive_style’, ‘fruitful_get_my_style’, 99);
function fruitful_get_my_style {
if (isset($theme_options[‘responsive’]) && ($theme_options[‘responsive’] == ‘on’)) {
wp_enqueue_style(‘main-style’, get_stylesheet_uri());
wp_enqueue_style( ‘woo-style’, get_stylesheet_directory_uri() . ‘/woocommerce/woo.css’);
} else {
wp_enqueue_style(‘main-style’, get_stylesheet_directory_uri() .’/fixed-style.css’);
wp_enqueue_style( ‘woo-style’, get_template_directory_uri() . ‘/woocommerce/woo-fixed.css’);
}
}Which breaks my site.
I’m a total beginner and have been coding for all of three weeks so I probably have missed something. I’ll just change the fruitful function for now, but it would be good to know how to fix this in my child theme to override it so I don’t have to keep manually fixing it any time there’s an update.
Forum: Themes and Templates
In reply to: [Fruitful] Responsive css loading before child themeUpdate: I got it to work by changing the function fruitful_get_responsive_style in functions.php — specifically:
function fruitful_get_responsive_style () {
$style_ = $back_style = $woo_style_ = ”;
$theme_options = fruitful_ret_options(“fruitful_theme_options”);wp_enqueue_style(‘fonts-style’, get_template_directory_uri() . ‘/inc/css/fonts-style.css’);
if (isset($theme_options[‘responsive’]) && ($theme_options[‘responsive’] == ‘on’)) {
wp_enqueue_style(‘main-style’, get_stylesheet_uri());
wp_enqueue_style( ‘woo-style’, get_stylesheet_directory_uri() . ‘/woocommerce/woo.css’); *From get_template_directory_uri.
*(then it goes on to describe the fixed styles but I abridged it here for brevity’s sake)
But this same code won’t work when placed in my child theme’s functions.php file. Anyone have any idea why?