0

I have the following in my child theme's functions.php:

add_action( 'ors_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri().'/style.css' );
    wp_enqueue_script('ors-animations', get_stylesheet_directory_uri().'/javascripts/animations.js', array( 'jquery' ));
}

The child theme is active, however, the file www.example.com/wp-content/themes/child-theme/javascripts/animations.js is not being enqueued.

Help appreciated.

  • ors_enqueue_scripts action hook? Where is it defined? Normally enqueuing is done inside wp_enqueue_scripts action. – bravokeyl Aug 14 '16 at 11:02
  • Are the other styles enqueued? – bravokeyl Aug 14 '16 at 11:03
  • Yes they are @bravokeyl. – Steve Aug 14 '16 at 13:28
  • What about my other question? – bravokeyl Aug 14 '16 at 13:55
2

I think you have typo in your code: ors_enqueue_scripts should be wp_enqueue_scripts

add_action( 'wp_enqueue_scripts',   'enqueue_parent_theme_style' );
function enqueue_parent_theme_style()
{
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri().'/style.css' ); 
wp_enqueue_script('ors-animations', get_stylesheet_directory_uri().'/javascripts/animations.js', array( 'jquery' )); 
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.