Forums

[Plugin: Custom Field Template] Identify the template used (6 posts)

  1. neotoxic
    Member
    Posted 3 years ago #

    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?

    http://wordpress.org/extend/plugins/custom-field-template/

  2. Hiroaki Miyashita
    Member
    Posted 3 years ago #

    You can find it by the following way.

    <?php
    $options = get_opetion('custom_field_template_data');
    var_dump($options['posts']);
    ?>
  3. neotoxic
    Member
    Posted 3 years ago #

    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?

  4. Hiroaki Miyashita
    Member
    Posted 3 years ago #

    I am sorry for my typo. get_option() is right code. Thanks.

  5. randyhoyt
    Member
    Posted 3 years ago #

    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.

  6. neotoxic
    Member
    Posted 3 years ago #

    Hiroaki - Thanks a lot, I am sorry I should have spotted that myself lol.

    Thanks randyhoyt

Topic Closed

This topic has been closed to new replies.

About this Topic