338 reputation
1311
bio website jakub.chodorowicz.pl
location
age
visits member for 4 years
seen 2 days ago

Sep
7
awarded  Self-Learner
Sep
3
awarded  Good Question
Mar
2
accepted get name of the current template file
Nov
22
awarded  Famous Question
Oct
27
awarded  Nice Question
Oct
5
comment get name of the current template file
Yes, it's true. To get the name of included file you'd probably need to use something like this echo __FILE__;
Sep
9
revised get name of the current template file
adding simpler version, direct printing template file name in template file
Apr
15
awarded  Yearling
Dec
5
awarded  Notable Question
Nov
6
awarded  Popular Question
Oct
19
answered Custom Post Type Archives by Date with Custom Permalink
Oct
14
awarded  Critic
Jul
28
awarded  Popular Question
Jun
24
awarded  Student
Apr
9
answered get name of the current template file
Feb
28
awarded  Commentator
Feb
28
revised get name of the current template file
additional info
Feb
28
comment get name of the current template file
@MikeSchinkel - it already has a patch :) core.trac.wordpress.org/ticket/16689
Feb
27
comment get name of the current template file
Yes, the actual need was to display the name of the currently used theme file, the code I posted had a flaw (which can be solved by moving the function out of the main theme folder), but @t31os' solution is much cleaner and fulfills the need, but, if I understand you correctly, the real problem (WP shouldn't try to read functions.php as page template file) still persists. I'll try to post it on trac, haven't done it yet. Greetings!
Feb
27
comment get name of the current template file
@MikeSchinkel - thanks for comment, but doesn't template_include hook, which t31os suggested, solve the issue? Or maybe I've misunderstood you.