Title: Calling scripts on certain page
Last modified: September 1, 2016

---

# Calling scripts on certain page

 *  [francisgallagher](https://wordpress.org/support/users/francisgallagher/)
 * (@francisgallagher)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/calling-scripts-on-certain-page/)
 * Im trying to call a cetain script on a certain page.
 *  ‘wp_register_script( ‘WPTS’,’[https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min](https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min).
   js’);’
    ‘wp_enqueue_script( ‘WPTS’,’[https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js&#8217](https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js&#8217););’
 * Here I want cancel calling this script on pages apart from the one I want to.
   
   if(! is_page(7084) ) { wp_dequeue_script(‘WPTS’); } Not sure where im going wrong..

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [outhands](https://wordpress.org/support/users/outhands/)
 * (@outhands)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/calling-scripts-on-certain-page/#post-7564829)
 * Did you action the wp_enqueue_script and wp_dequeue_script hook ?
 *  [cedcommerce](https://wordpress.org/support/users/cedcommerce/)
 * (@cedcommerce)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/calling-scripts-on-certain-page/#post-7564844)
 * Hello francisgallagher,
    Please add this code in functions.php file.
 *     ```
       /**
        * Dequeue Script
        * Hooked to the wp_print_scripts action, with a late priority (100),
        * so that it is after the script was enqueued.
        */
   
       function dequeue_script_on_specific_page() {
        if(!is_page(7084) ) {
         wp_dequeue_script('WPTS');
        }
       }
       add_action( 'wp_print_scripts', 'dequeue_script_on_specific_page', 100 );
       ```
   
 * Hope this will solve your problem.
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Calling scripts on certain page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [cedcommerce](https://wordpress.org/support/users/cedcommerce/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/calling-scripts-on-certain-page/#post-7564844)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
