Title: custom fields and strings
Last modified: August 21, 2016

---

# custom fields and strings

 *  [Gabums](https://wordpress.org/support/users/gabums/)
 * (@gabums)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-and-strings/)
 * Good afternoon,
 * I’m trying to get the value of one of my custom fields but it keeps returning“
   array array array”. I figured it was because there were nested custom fields.
   When I broke it down, I got this:
 *     ```
       s:17:"content_main_area";
       		a:4: {
       			i:0;
       			a:6:{
       				s:20:"dynamic_element_type";
       				s:9:"_text_box";
       				s:7:"pb_area";
       				s:17:"content_main_area";
       				s:6:"_sizer";
       				s:10:"two-thirds";
       				s:9:"stb_title";
       				s:15:"Paying for Care";
       				s:11:"stb_content";
       				s:1875:" $mydata = '
       ```
   
 * So it appears to me that my custom field contains a string within a string. I’m
   trying to get make something like this:
 *     ```
       $custom_field = get_post_meta($post->ID, $zn_meta_elements['content_main_area']['stb_content'], true);
       ```
   
 * With $zn_meta_elements as my custom field and “content_main_area” and “stb_content”
   are the strings. The goal is to get the value of “stb_content” (which might be
   $mydata????). It seems my syntax is off and all my google searches are now showing
   purple links.
 * Can anyone point me in the right direction? Thanks so much!
 * Cheers!

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

 *  [silver530](https://wordpress.org/support/users/silver530/)
 * (@silver530)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-and-strings/#post-5007401)
 * Hi, try to use `get_the_ID()` function instead of `$post->ID`
 *  Thread Starter [Gabums](https://wordpress.org/support/users/gabums/)
 * (@gabums)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-and-strings/#post-5007414)
 * Hi!
 * Thank you for your suggestion. Unfortunately it still returns the same thing
 *     ```
       $custom_field = get_post_meta(get_the_ID(), $zn_meta_elements['content_main_area']['stb_content'], true);
       ```
   
 * I’ve also used other variations of get_the_ID() and tried with different field
   name and string combinations.

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

The topic ‘custom fields and strings’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Gabums](https://wordpress.org/support/users/gabums/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/custom-fields-and-strings/#post-5007414)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
