Title: Custom field with multiple value?
Last modified: August 20, 2016

---

# Custom field with multiple value?

 *  [yhosi](https://wordpress.org/support/users/yhosi/)
 * (@yhosi)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/custom-field-with-multiple-value/)
 * I want multiple values for one custom field.
    The value should change if a vistor
   clicks on a link on my blog.
 * For example:
 * I have a custom field named “picture”.
    This custom field should contain 2 different
   values. One Value should be “www.example.com/picture1.jpg” the other value should
   be “www.example.com/picture2.jpg”.
 * If someone clicks on a link “Picture 1” or “Picture 2” the value of the custom
   field should change to the specified value.
 * Please help! I am begging you please, please help!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Cudazi](https://wordpress.org/support/users/cudazi/)
 * (@cudazi)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/custom-field-with-multiple-value/#post-2272269)
 * You can add multiple custom fields using the same key on your post or page.
 * While I don’t know your specific theme setup, you can loop through each via this
   simplified script below…
 *     ```
       <?php
       $pictures = get_post_meta($post->ID, 'picture', false);
       foreach($pictures as $picture) {
        echo $picture; // do something
       }
       ?>
       ```
   
 * Note the third “false” parameter above from:
    [http://codex.wordpress.org/Function_Reference/get_post_meta#Parameters](http://codex.wordpress.org/Function_Reference/get_post_meta#Parameters)
 *  [yhosi_2](https://wordpress.org/support/users/yhosi_2/)
 * (@yhosi_2)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/custom-field-with-multiple-value/#post-2272355)
 * But how do I make this, if somebody clicks on a link and the value changes?
 * Thank you very much for your reply.
 * (Sorry, I lost my password that’s why this is another account)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom field with multiple value?’ is closed to new replies.

## Tags

 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)

 * 2 replies
 * 3 participants
 * Last reply from: [yhosi_2](https://wordpress.org/support/users/yhosi_2/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/custom-field-with-multiple-value/#post-2272355)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
