0

I am trying to implement animate.css with my Twenty Twelve child theme. I read this post about trying to implement it (option 1), but it is not working. The only thing I am doing differently is that I have a child theme. Any thoughts? Thanks a lot!

Edit: Milo, you're first answer did not work. This is my code in my child theme's function.php:

function paukai_2011_styles() {
    wp_register_style( 'animate-css',
        get_stylesheet_directory_uri() . 'http://shaansingh.me/wp-content/themes/twenty-twelve-child/animate.min.css',
        array(),
        '20120725',
        'screen' );
    wp_enqueue_style( 'animate-css' );
}

And here is my html:

<p class="animated wobble">This is dummy text</p>

No luck unfortunately.

2
  • Define "not working" ? Do you see stylesheet properly appearing in page source? What is (not) happening?
    – Rarst
    Commented Jun 15, 2013 at 22:17
  • The animation is not appearing.
    – user33956
    Commented Jun 17, 2013 at 16:10

1 Answer 1

0

The example in the page you linked uses get_template_directory_uri(), which will only give you the parent theme URI. If you want to target something in a child theme, you have to swap that for get_stylesheet_directory_uri(), which will give you the child theme URI, in the event a child theme is being used.

3
  • I was linking to the .css file in the parent theme (I had put it there), but I will try this.
    – user33956
    Commented Jun 17, 2013 at 16:14
  • See my original post for the response to your answer.
    – user33956
    Commented Jun 17, 2013 at 16:26
  • you're prepending get_stylesheet_directory_uri to a full path, it should just be get_stylesheet_directory_uri() . '/animate.min.css' if it's in the root of your child theme directory.
    – Milo
    Commented Jun 17, 2013 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.