-
Alexander
Hey guys,
I cant get rid of a CSS File. I wondered why my css changes dont show up and eventually saw that there are two CSS Files stored in the childtheme folder.
1. style.css?ver=6.4.3
2. style.css?ver=1708354149How do I get rid of the second. I deactivated all caching plugins. De- and reactivated GP Dynamic Cache and cleared every caches I can think of 😀 File does not exist via FTP also.
what am I missing?
Thank you
-
Hi there,
does you child theme contain any custom functions for enqueuing the stylesheets?
As GP will automatically enqueue thestyle.css
for you. So you don’t have to. -
Alexander
Hi David thank you for your reply,
indeed I have some files enqued:
/*
* Load Stylesheets
*/
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
// Registrieren und einbinden von parent-style
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );// Registrieren und einbinden von child-style, typo-style, colors-style und effects-style
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array(‘parent-style’)
);wp_enqueue_style( ‘typo-style’,
get_stylesheet_directory_uri() . ‘/typo.css’,
array(‘child-style’)
);
wp_enqueue_style( ‘colors-style’,
get_stylesheet_directory_uri() . ‘/colors.css’,
array(‘child-style’)
);
wp_enqueue_style( ‘effects-style’,
get_stylesheet_directory_uri() . ‘/effects.css’,
array(‘child-style’)
);
}I tried do remove the first, the second, and both of them, but then my styles are all lost.
What can i do?
-
Yeah neither of the two enqueues are required as GP detects the child theme and handles parent and child styles for you.
But i just checked the site and i only see the one child style loading now. Did you resolve the issue ?
-
Alexander
Hi David,
I managed to have only one css file now. Changed the code to:
/*
* Load Stylesheets
*/
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
// Registrieren und einbinden von typo-style, colors-style und effects-style
wp_enqueue_style( ‘typo-style’,
get_stylesheet_directory_uri() . ‘/typo.css’
);
wp_enqueue_style( ‘colors-style’,
get_stylesheet_directory_uri() . ‘/colors.css’
);
wp_enqueue_style( ‘effects-style’,
get_stylesheet_directory_uri() . ‘/effects.css’
);
}CSS Version has still a very long number style.css?ver=1708427513 but I think its working now. Thank you very much for the hint!
-
Glad to be of help!
- You must be logged in to reply to this topic.