How to override a special css.file in a child theme
-
Hi,
I created a child theme and it works with the main style.css file but I have a second file in which I need to make changes. This file however is not in the root of the child theme but in css/grid.css.
How can I now replace the child grid.css with the original one in the theme?
I’m searching now for hours and tried all kind of tippsfunction 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') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' , PHP_INT_MAX);
That’s the file that I need to replace with the altered child grid.css
<link rel=’stylesheet’ id=’photography-responsive-css-css’ href=’https://domain.com/wp-content/themes/photography/css/grid.css’ type=’text/css’ media=’all’ />
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to override a special css.file in a child theme’ is closed to new replies.