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
(@nameez)
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
(@nameez)
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
(@nameez)
Sorry this is the first time i’m trying to use custom posts, custom post (projects) is made from the plugin called Types (https://ww.wp.xz.cn/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
[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
(@nameez)
Brilliant! thanks.
Great plugin and great support, 5 star rated.
Thanks, I’m glad that worked. 🙂