Title: [Plugin: Custom Fields Creator] Image DIsplay
Last modified: August 20, 2016

---

# [Plugin: Custom Fields Creator] Image DIsplay

 *  [gowrann](https://wordpress.org/support/users/gowrann/)
 * (@gowrann)
 * [14 years ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/)
 * Hi,
 * Great plugin – but can’t get images to display – I have watched the tutorial 
   but images are not displaying. My code is:
 *     ```
       <div id="quotes"><h3>Quotes</h3>
       			<?php $quotes = get_post_meta( $post->ID, 'quotes', true );
       			foreach( $quotes as $quote){
       			   	echo '<div>';
       				echo '<img src="' . $quote['quotes_pic'] . '" class="alignleft" />';
       				echo '<p>' . $quote['quotes_text'] . '</p>';
       				echo '<p><strong>' . $quote['quotes_author'] . '</strong></p>';
       				echo '</div>';
       }
   
       			?>
       ```
   
 * but that brings in the attachment ID as the path – what is the right way to get
   the path and also display a certain size.
 * Thanks
 * [http://wordpress.org/extend/plugins/custom-fields-creator/](http://wordpress.org/extend/plugins/custom-fields-creator/)

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

 *  Plugin Contributor [madalin.ungureanu](https://wordpress.org/support/users/madalinungureanu/)
 * (@madalinungureanu)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842186)
 * Hello!
 * In version 1.0.2 we changed the upload field from storing the url to the file
   into storing the attachment ID for the file.
 * So now you can use functions like [wp_get_attachment_image](http://codex.wordpress.org/Function_Reference/wp_get_attachment_image),
   [wp_get_attachment_image_src](http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src)
   or [wp_get_attachment_url](http://codex.wordpress.org/Function_Reference/wp_get_attachment_url)
   depending on the desired functionality
 *  Thread Starter [gowrann](https://wordpress.org/support/users/gowrann/)
 * (@gowrann)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842189)
 * hi is it possible you can state the code/syntax for the function to display the
   image – wp_get_attachment_image, wp_get_attachment_image_src or wp_get_attachment_url
   to actually display the link (sorry…. just starting out in php)
 * I received your reply via email but is not listed here in WordPress support
 * Thanks
 *  Plugin Contributor [madalin.ungureanu](https://wordpress.org/support/users/madalinungureanu/)
 * (@madalinungureanu)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842198)
 * In case you didn’t get the codex links from my previous answer here they are 
   again:
    [http://codex.wordpress.org/Function_Reference/wp_get_attachment_image](http://codex.wordpress.org/Function_Reference/wp_get_attachment_image)
   [http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src](http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src)
   [http://codex.wordpress.org/Function_Reference/wp_get_attachment_url](http://codex.wordpress.org/Function_Reference/wp_get_attachment_url)
 * They provide a pretty detailed description of the functions and also usage examples.
   Hope it helps!
 *  [Pedromrferreira](https://wordpress.org/support/users/pedromrferreira/)
 * (@pedromrferreira)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842211)
 * Hi, love your plugin.
    Cant put images working, who do I set the code for wp_get_attachment_image
   on version 1.0.3? can you explane the code? Thanks
 *  [brendanrandall](https://wordpress.org/support/users/brendanrandall/)
 * (@brendanrandall)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842213)
 * I’m having the same issue. The plugin is great indeed but could you give a full
   code example of getting the image with version 1.0.3 upwards. If we take a simple
   use case:
 * foreach($items as $item){
    echo ‘<img src=”‘.$item[‘item_pic’].'” />’; }
 * What would be the code equivalent in the newer version?
 * Many thanks.
 *  [brendanrandall](https://wordpress.org/support/users/brendanrandall/)
 * (@brendanrandall)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842214)
 * Hey Pedromrferreira,
 * I’ve been looking into this and i have a solution for you. Please see below. 
   Hopefully this will help others out since the change in the plugin’s way of accessing
   images. The exampel below is something i’ve worked up which loops through all
   images in a repeater and outputs both a thumbnail and full size image so you 
   can pick from what you want. If you have other sizes specified in Worpdress you
   can just replace ‘full’ with your named image size:
 * <?php
 * $clientimages = get_post_meta( $post->ID, ‘clients’, true );
 * foreach($clientimages as $clientimage){ // For each loop for
    $thumbnail = wp_get_attachment_image_src(
   $clientimage[‘clientimage’] ); $full = wp_get_attachment_image_src( $clientimage[‘
   clientimage’],’full’ ); echo ‘<img src=”‘ . $thumbnail[0] . ‘” />’; echo ‘<img
   src=”‘ . $full[0] . ‘” />’; }
 * ?>
 *  [Pedromrferreira](https://wordpress.org/support/users/pedromrferreira/)
 * (@pedromrferreira)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842215)
 * OK, got it:
 *     ```
       <?php
       $actividades = get_post_meta( $post->ID, 'actividades', true );
       echo '<ul class="content-act">';
       foreach( $actividades as $actividade){
       echo '
   
       <li>';
       echo '<h2>' . $actividade['titulo'] . '</h2>';
       $attachment_image = wp_get_attachment_image_src($actividade['imagem'], 'full');
   
       echo '<img src="'. $attachment_image[0].'" width="<'. $attachment_image[1] .'" height="'. $attachment_image[2] .'"/>';
       echo '<p>' . $actividade['descricao'] . '</p>';
       echo '</li>
       ';
       }
       echo '';
   
       ?>
       ```
   
 *  [Tukaram Kalane](https://wordpress.org/support/users/tukaram-kalane/)
 * (@tukaram-kalane)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842216)
 * Use This: Had same problem… It worked for me…
 *     ```
       $result = wp_get_attachment_image_src($addbooks['book-image']);
       $url = $result[0];
       echo '<img src="'. $url.'" >';
       ```
   
 * where,
    ‘$addbooks’ : name of metabox. ‘book-image’ : name of image field. It
   will show image in thumbnail for showing full image. USe: `$result = wp_get_attachment_image_src(
   $addbooks['book-image'],'full');`
 * Hope it will help you…
    Happy Coding…!!! -TK

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

The topic ‘[Plugin: Custom Fields Creator] Image DIsplay’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-fields-creator.svg)
 * [Custom Fields Creator](https://wordpress.org/plugins/custom-fields-creator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-fields-creator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-fields-creator/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-fields-creator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-fields-creator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-fields-creator/reviews/)

## Tags

 * [images](https://wordpress.org/support/topic-tag/images/)
 * [path](https://wordpress.org/support/topic-tag/path/)
 * [repeater](https://wordpress.org/support/topic-tag/repeater/)

 * 8 replies
 * 5 participants
 * Last reply from: [Tukaram Kalane](https://wordpress.org/support/users/tukaram-kalane/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-custom-fields-creator-image-display/#post-2842216)
 * Status: not resolved