Title: Loop through custom Fields from self build plugin
Last modified: August 30, 2016

---

# Loop through custom Fields from self build plugin

 *  [ners10100100](https://wordpress.org/support/users/ners10100100/)
 * (@ners10100100)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/loop-through-custom-fields-from-self-build-plugin/)
 * Hey all! I’m new to WP and I am trying to build a Plugin. I’m kinda done with
   it but I dont get how to loop through the custom fields I’ve build.
 * If I do a var_dump on my Array it looks like this:
 *     ```
       array(2) {
           [0] => array(3) {
               ["title"] => string(11)
               "First Title" ["content"] => string(13)
               "First Content" ["image"] => string(67)
               "http://localhost/wordpress/wp-content/uploads/2015/09/hotel1-29.jpg"
           }[1] => array(3) {
               ["title"] => string(13)
               "Second title " ["content"] => string(14)
               "Second Content" ["image"] => string(67)
               "http://localhost/wordpress/wp-content/uploads/2015/09/image-29.jpg"
           }
       }
       ```
   
 * Appreciate any advice!
 * Thanks in Advance
 * ners

Viewing 1 replies (of 1 total)

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/loop-through-custom-fields-from-self-build-plugin/#post-6531327)
 * Just use a foreach loop on your variable:
 *     ```
       foreach( $myfields as $key => $value ) {
   
           echo $value['title'];  // This is the title of each array item
           echo $value['content'];  // This is the content of each array item
           echo $value['image'];  // This is your image link of each array item
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Loop through custom Fields from self build plugin’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/loop-through-custom-fields-from-self-build-plugin/#post-6531327)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
