Archived topic
Using external css with GP Elements
3 replies · Started by Theo on September 13, 2018
Hi,
I was testing to use Daniel Eden's animate.css (see https://daneden.github.io/animate.css/ ). Ended up enqueuing it in my child theme's functions.php and that works. But I was actually looking to do this with the new GP Elements and couldn't get it to work. Just wondering if you could tell me what I did wrong?
1. Uploaded animate.min.css to my child theme's directory
2. Made a new hook with <link rel="stylesheet" href="animate.min.css" type="text/css">
3. Set the hook to wp_head, Entire site, all users, and published it
The animation didn't work, the css didn't seem to load. As said, the css is fine; once I added in functions.php
add_action( 'wp_enqueue_scripts', 'ts_child_theme_enqueue' );
function ts_child_theme_enqueue() {
wp_enqueue_style( 'child-theme-style', get_stylesheet_directory_uri() . '/animate.min.css');
}
the animation worked.
Would appreciate to hear how I could get this to work with Elements.
Kind regards,
Theo
Hi there,
You would need to use the full URL to the animate.css file instead of just the name.
I do suggest sticking with wp_enqueue_style though :)
Hi Tom,
I believe I also tested using the full url starting with https, but nevermind. I'll leave it in functions.php then.
Thanks!
No problem :)