Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // add a JavaScript to a page
- // code goes in functions.php for your child theme
- add_action( 'wp_enqueue_scripts', 'add_my_script' );
- function add_my_script() {
- $my_page_id = 57; // set to the required page
- if ($my_page_id == get_the_id() ) {
- wp_enqueue_script( 'my-js', '/wp-content/uploads/my_script.js', array(), "1", true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement