Title: Attachment image problem!
Last modified: August 30, 2016

---

# Attachment image problem!

 *  Resolved [Nam_n](https://wordpress.org/support/users/nameez/)
 * (@nameez)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/)
 * Hi,
 * I have a image custom field defiled in a custom post type called projects, can
   i know how to do the shortcode to loop through the posts and show images for 
   each entry please.
 * I tried this:
 *     ```
       [loop type=projects]
       [attached]
       <img scr="[field image=wpcf-image-1]">
       [/attached]
       [field excerpt]
       [/loop]
       ```
   
 * It doesn’t show the image, but prints the path to it.
 * Please advice.
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

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

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413313)
 * Hello,
 * This is because `[attached]` is for attachments, not image fields.
 * To display an image field for each post:
 *     ```
       [loop type=projects]
         [field image=wpcf-image-1]
         [field excerpt]
       [/loop]
       ```
   
 * For details, please see the documentation under Main Features -> Content -> Parameters:
   Image Field.
 *  Thread Starter [Nam_n](https://wordpress.org/support/users/nameez/)
 * (@nameez)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413339)
 * Hi,
 * Thanks for the reply.
 * I tried that but it doesn’t return anything except for the excerpt, when i add
   attched shortcode it prints the path to image..
 * any ideas?
 * Thanks
 *  Thread Starter [Nam_n](https://wordpress.org/support/users/nameez/)
 * (@nameez)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413347)
 * This is how the fields look in content overview page:
 * [https://www.dropbox.com/s/56hsa7k9poye8qr/Screenshot%202015-08-09%2013.47.42.png?dl=0](https://www.dropbox.com/s/56hsa7k9poye8qr/Screenshot%202015-08-09%2013.47.42.png?dl=0)
 * Thanks
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413359)
 * Could you tell me what kind of field value it contains?
 *     ```
       [field wpcf-image-1]
       ```
   
 * I believe that should display a number, the image’s ID.
 * You can also try the following:
 *     ```
       [loop type=projects]
         [attached]
           <img src="[field url]">
         [/attached]
         ...
       [/loop]
       ```
   
 * But in that case, it will display _all_ attachments of the post – not only what’s
   inside the image field.
 *  Thread Starter [Nam_n](https://wordpress.org/support/users/nameez/)
 * (@nameez)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413368)
 * Sorry this is the first time i’m trying to use custom posts, custom post (projects)
   is made from the plugin called Types ([https://wordpress.org/plugins/types/](https://wordpress.org/plugins/types/))
   and i have added a custom field called image to it for the user to upload the
   image for the project.
 * To answer your questions:
 * `[field wpcf-image-1]`
 * should contain the path to the image uploaded.
 * And
 *     ```
       [loop type=projects]
         [attached]
           <img src="[field url]">
         [/attached]
         ...
       [/loop]
       ```
   
 * Doesn’t seems to be returning anything.
 * I should say your plugin works brilliantly with loop and other data, this is 
   the only issue i have.
 * Thanks
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413378)
 * > [field wpcf-image-1] should contain the path to the image uploaded.
 * In that case, how about this?
 *     ```
       [loop type=projects]
         <img src="[field wpcf-image-1]">
         [field excerpt]
       [/loop]
       ```
   
 *  Thread Starter [Nam_n](https://wordpress.org/support/users/nameez/)
 * (@nameez)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413380)
 * Brilliant! thanks.
    Great plugin and great support, 5 star rated.
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413394)
 * Thanks, I’m glad that worked. 🙂

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

The topic ‘Attachment image problem!’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/attachment-image-problem/#post-6413394)
 * Status: resolved