WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple problem I'm hoping someone can shed some light on. I have a child theme with a custom page template and I'm simply trying to check weather or not the template is in use. Under normal circumstances, I would have just used the is_page_template function, however it doesn't seem to be working with child themes. I've tried the following

    //do something..

as well as

    //do something..

Neiter works and I was hoping there is a more elegant solution than using $_SERVER to check for URLs. I can't imagine there not being a function for this seeing as this seems like a common task. I believe the problem is the difference between template and stylesheet directories. Is it possible to use Wordpress to check for page templates located in a child theme?

Thanks in advance!

share|improve this question
where are the files you checking this? is it possible that the page template uses a custom query which is not reset properly? – Michael Mar 13 '13 at 12:59
This does not work for me either. So far have not found any solution. – Harish Chouhan Apr 12 '14 at 3:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.