Do you mean Page template? or just any template?
Actually I don’t know the answer – all the Conditional_Tags are at this link.
If it’s about Page templates – Pages use the template you select or… according to Template_Hierarchy.
Yeah, I mean page template. So I can do different things in say, header.php, depending on what template is being used.
I’ve actually found a way of doing this aftyer digging through functions.php for a bit. get_page_template() returns the name of the template but with the entire absolute address of the server as well. So it’s a bit long winded, but is doing the job! 🙂
There really should be a nice clean function to find what page template you are using though. As I suggest earlier:
is_template(‘name’) would be good.
“There really should be a nice clean function to find what page template you are using though.“
Any Page assigned a template retains it in the ‘_wp_page_template’ custom field. Here’s your function:
http://paste.uni.cc/8446
Note I call the function is_page_template() to clarify use (and avoid conflict with any is_template() function appearing later). If running WordPress 2.0, you can drop this in a functions.php file and save it with your active theme, and WordPress will automatically include it.
Nice one Kafkaesqui. That’s exactly what I was looking for. Cheers.