0

I am trying to enqueue a jQuery script to my Wordpress site but for some reason it is not adding. Below is my code I've added to my child theme's functions.php file.

<?php

function itm_adding_scripts() {
wp_register_script('my_amazing_script', '/wp-content/themes/italic-child/js/jQuery.equalHeights.js/js/jQuery.equalHeights.js',   array('jquery'),'1.1', true);
wp_enqueue_script('my_amazing_script');
}

add_action( '_enqueue_scripts', 'itm_adding_scripts' );  
?>
0

2 Answers 2

1

You have a typo in the action missing wp prefix

Change

add_action( '_enqueue_scripts', 'itm_adding_scripts' ); 

To

add_action( 'wp_enqueue_scripts', 'itm_adding_scripts' ); 

Reference: wp_enqueue_scripts docs

Sign up to request clarification or add additional context in comments.

Comments

0

You have a typo in your action. It should be wp_enqueue_scripts

add_action( 'wp_enqueue_scripts', 'itm_adding_scripts' );  

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.