Hi there, I am sure this is really easy, but I need to identity what template was used for the post in the loop. I thought the template ID was part of the metadata.. but its not.. or I can't find it.
Can anyone help?
Hi there, I am sure this is really easy, but I need to identity what template was used for the post in the loop. I thought the template ID was part of the metadata.. but its not.. or I can't find it.
Can anyone help?
You can find it by the following way.
<?php
$options = get_opetion('custom_field_template_data');
var_dump($options['posts']);
?>Hi there, thanks for the reply.
I tried the code you suggested but I get the following error:
"Call to undefined function get_opetion()"
I am using WordPress 2.7.1 Where is this function supposed to be defined?
I am sorry for my typo. get_option() is right code. Thanks.
I am using the following code to determine which template is used for a given post.
$options = get_option('custom_field_template_data');
$custom_field_template = $options['posts'][$post->ID];
That code should put the ID of the template into that variable.
Hiroaki - Thanks a lot, I am sorry I should have spotted that myself lol.
Thanks randyhoyt
This topic has been closed to new replies.