0

I'm trying to add Maps JavaScript API in wordpress without plugins. I have seen that to do that I need to use the wp_enqueue_script() function.

However, I would like to know what is the correct way to add this function in the functions.php file?

Thank's

1
  • 1
    Checkout the documentation. The first and most-upvoted comment shows an example. Commented Aug 4, 2022 at 13:18

1 Answer 1

1
function enqueue_custom_scripts() { 
  
    wp_enqueue_script( 'script-nname', 'https://www.script.com/script.js' ,array('jquery'),NULL,true );
}
add_action( 'wp_enqueue_scripts', 'enqueue_custom_scripts' );
 
Sign up to request clarification or add additional context in comments.

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.