• I want to add a poll on specific posts when I add a custom field to the post. The key I’ve named is ‘poll’…so when I add the ‘poll’ custom field I set the value to the # of the poll I want displayed on the post.

    Since my poll is specific to the post I can’t just post the code for the poll with the static number…I want the poll number to be dynamic based on the value of the custom field ‘poll’ if/when I add it to the post.

    Here’s part of the code:

    echo $php_poll->poll_process(4);

    In the code above the # of the poll is 4, but this code is in the ‘Post Template’ and I need the number to be dynamic. What is the code I need to put in place of the ‘4’ so that it is replaced with the the value of ‘poll’ in the custom field I add to the post.

    Any ideas? Or is what I’m asking not even possible? I have yet to add any plugins and have been trying to figure out how to just display ONLY the ‘value’ of a ‘key’…the only template tag I’ve found is the_meta() which gives me ‘key:value’ which does me no good…I just need ‘value’.

    I look forward to your feedback.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Code to get VALUE for a KEY?’ is closed to new replies.