• Resolved wetseedwild

    (@wetseedwild)


    Hi there. I am using a child theme of OCEANWP, as well as Elementor.

    My child theme style.css is being ignored in place of styles set via Customize and/or Elementor. I would rather include all style settings in my child theme’s style.css and leave all settings in Customize and in Elementor as set to Default. (Elementor is set to adopt colors/themes from my theme, not to its own default.)

    Any help would be appreciated!

    My child theme has a functions.php that looks like this:

    <?php
    add_action('wp_enqueue_scripts', 'enqueue_parent_styles');
    
    function enqueue_parent_styles() {
    	wp_enqueue_style( 'oceanwp', get_template_directory_uri().'/style.css' );
    }
    ?>

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Have you activated the OceanWP child theme? I didn’t see the child theme on your site.

    Thread Starter wetseedwild

    (@wetseedwild)

    Hi Amit, thanks for your response. Yes, my child theme (entitled “Golden Ticket”) is active, as far as I can tell. Any idea as why my child’s stylesheet isn’t running?

    Are you using Official OceanWP child theme? Try to use the below code instead of the above one and check it works or not –
    Child theme documentation – https://docs.oceanwp.org/article/90-sample-child-theme

    function oceanwp_child_enqueue_parent_style() {
    	$theme   = wp_get_theme( 'OceanWP' );
    	$version = $theme->get( 'Version' );
    	wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'oceanwp-style' ), $version );	
    }
    add_action( 'wp_enqueue_scripts', 'oceanwp_child_enqueue_parent_style' );
    Thread Starter wetseedwild

    (@wetseedwild)

    Thank you, Amit! That seems to have solved the problem.

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child Theme stylesheet’ is closed to new replies.