[Resolved] Using external css with GP Elements

Home Forums Support [Resolved] Using external css with GP Elements

Home Forums Support Using external css with GP Elements

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #676640
    Theo

    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

    GeneratePress 2.1.4
    GP Premium 1.7.2
    #676817
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #676944
    Theo

    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!

    #677277
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.