Site logo

Archived topic

Child theme's style.css and elements not working at the same time

3 replies · Started by Neil on November 24, 2019

Viewing posts 1–4 of 4

I have a problem with the CSS within my child theme not working when I have the following in functions.php`.

function generatepress_child_enqueue_scripts() {
	if ( is_rtl() ) {
		wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
	}
}
add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );

add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_style( 'generate-child' );
}, 50 );

The problem is solved when I remove:

add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_style( 'generate-child' );
}, 50 );

However, this stops the Elements from working.

Is there a solution where I can get both the CSS in the child theme and the elements working at the same time?

Thanks very much. This seems to have fixed the issue.

No problem :)

This archived topic is closed to new replies.