Title: is_page_template inside functions.php
Last modified: August 21, 2016

---

# is_page_template inside functions.php

 *  [4nt0n](https://wordpress.org/support/users/4nt0n/)
 * (@4nt0n)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/is_page_template-inside-functionsphp/)
 * hello
    I am trying to do sth like this:
 *     ```
       if(is_page_template('current.php')){
                add_action('wp_print_styles', 'reset_css_current', 99999);
       }
   
       function reset_css_current(){
       	wp_dequeue_style('bootstrapwp', get_template_directory_uri().'/css/bootstrapwp.css');
       	wp_deregister_style('bootstrapwp', get_template_directory_uri().'/css/bootstrapwp.css');
       }
       ```
   
 * But it the is_page_template() doesn’t work.
    Any ideas???

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/is_page_template-inside-functionsphp/#post-3850412)
 * Is the function used [inside the Loop](http://codex.wordpress.org/Function_Reference/is_page_template#Cannot_Be_Used_Inside_The_Loop)?
   If so, you will need to save the value to your own global variable before the
   loop and declare that same variable global in your function.
 * If you are calling the function before the Loop, try adding `global $wpdb;` in
   the function.

Viewing 1 replies (of 1 total)

The topic ‘is_page_template inside functions.php’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/is_page_template-inside-functionsphp/#post-3850412)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
