Archived topic
Where to upload custom .css files
2 replies · Started by Antonio on December 6, 2017
Hi all 🙂
Small question:
Where can I upload my custom .css files (via FTP) and be sure that they will not be lost when I update the GeneratePress theme?
Can I place them in my the Generate Press css folder?
I would like to link my own CSS files in the Hooks without write my own CSS directly in WordPress or by using some external Plugins for CSS.
Note: my CSS code is larger than 1500 lines, so the Simple CSS Plugin from Tom is not an option, even if I love it 🙁
Thanks in advance
Hi there,
Child theme will be your best option:
https://docs.generatepress.com/article/adding-css/#using-a-child-theme
https://docs.generatepress.com/article/using-child-theme/
Then in your child theme functions.php, you would need to enqueue your CSS file:
add_action( 'wp_enqueue_scripts', 'tu_child_theme_enqueue' );
function tu_child_theme_enqueue() {
wp_enqueue_style( 'child-theme-style', get_stylesheet_directory_uri() . '/custom.css');
}