Title: Can&#8217;t read multiple custom fields
Last modified: August 18, 2016

---

# Can’t read multiple custom fields

 *  [rrho](https://wordpress.org/support/users/rrho/)
 * (@rrho)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/cant-read-multiple-custom-fields/)
 * I am a bit at a loss.
 * I have a custom field with key (let’s say) ‘foo’ defined, and in one post this
   is used twice, once with ‘bar’, once with ‘fraggle’ as values.
 * There is no problem calling ‘bar’ with `get_post_meta($post_id, 'foo', TRUE)`,
   so obviously the fields are there, and in the right post.
 * However, when I try to call both of them into an array as in
 * `if(get_post_custom_values('foo')) {
    /* do something */ foreach (get_post_custom_values('
   foo') as $single_foo) { /* do some more and so on
 * I never even get to do _something_, let alone _some more_. Am I missing something
   important here, am I blindfolded?

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

 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/cant-read-multiple-custom-fields/#post-269834)
 * Did you use it inside the Loop?
 *  Thread Starter [rrho](https://wordpress.org/support/users/rrho/)
 * (@rrho)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/cant-read-multiple-custom-fields/#post-269897)
 * Yes, inside the loop, basically between `the_title()` and `the_content()` (which
   both work the way they should).

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

The topic ‘Can’t read multiple custom fields’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [rrho](https://wordpress.org/support/users/rrho/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/cant-read-multiple-custom-fields/#post-269897)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
