Title: Repeatable Fields Examples
Last modified: August 22, 2016

---

# Repeatable Fields Examples

 *  Resolved [bluemuse](https://wordpress.org/support/users/bluemuse/)
 * (@bluemuse)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/)
 * Hi,
 * Are there any examples of how to display repeatable fields on the front end?
 * I’m using the genisis framework and can get non-repeatable meta-boxes to show.
   For example: genesis_get_custom_field(‘_cmb2_test_textsmall’) works fine for 
   a field entitled test_textsmall.
 * I’m not able to figure out how to get repeatable fields to display on the front
   end.
 * Glad to see this library is being updated.
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 7 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/#post-5423854)
 * Looking things over, the repeatable fields end up storing the meta into 1 meta
   key, and as a serialized array which is what is returned when you do a get_post_meta()
   call
 * So, for example, say you have a repeatable color picker, and add 4 colors. The
   meta_key is `_bluemuse_colors`.
 * You would need to do something like the following to display all four. Pretend
   we’re in the loop for the purpose of the demo.
 *     ```
       $mycolors = get_post_meta( get_the_ID(), '_bluemuse_colors', true );
   
       foreach( $mycolors as $color ) {
           echo 'The Color hex is: ' . $color;
       }
       ```
   
 * This would echo out each item in the array that gets assigned to $mycolors, by
   looping over it and doing something with each array index, represented by the
   $color variable name.
 * Hopefully this makes sense, but let me know if you need a bit more help.
 *  Thread Starter [bluemuse](https://wordpress.org/support/users/bluemuse/)
 * (@bluemuse)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/#post-5423875)
 * Would it be possible to show an actual working example of this in action?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 7 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/#post-5423951)
 * Given that I don’t have access to your website, I won’t be able to do a live 
   working example, but if you could pastebin/gist the CMB2 code you’re using, I
   should be able to type up some copy/paste-able code using your actual meta keys.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 4 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/#post-5424243)
 * Any update to this one bluemuse?

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

The topic ‘Repeatable Fields Examples’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/repeatable-fields-examples/#post-5424243)
 * Status: resolved