Title: Code to get VALUE for a KEY?
Last modified: August 18, 2016

---

# Code to get VALUE for a KEY?

 *  [sammymns](https://wordpress.org/support/users/sammymns/)
 * (@sammymns)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/code-to-get-value-for-a-key/)
 * 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)

 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/code-to-get-value-for-a-key/#post-254027)
 * Some example here
    [Using_Custom_Fields](http://codex.wordpress.org/Using_Custom_Fields)

Viewing 1 replies (of 1 total)

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/code-to-get-value-for-a-key/#post-254027)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
