Skip Navigation

[Resolved] how can I display images with a certain tag in a view?

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#595081
media-file.jpg
code-in-view.jpg
all-posts-with-taxonomy-kou.jpg

on my website hidden link I made a filter to show pages, posts, custom posts and images in 1 view. I see al the posts, except the images. How can i make them show up?
When you test, search with the word "Kou"

Can you give me the right code for the view?

[wpv-conditional if="( '[wpv-post-type]' eq 'media' )"]
<div class="type ber">
<h3>[wpv-post-link]</h3>
<span class="ext">[types field='extra-informatie'][/types]</span>
[wpv-post-body output="raw"] Bekijk
</div>
[/wpv-conditional]

#595251

Media should not be displayed directly in a View, usually.

Usually you create a view and Query the Post type where you write your post, not the Media Post type.

Then, in those posts you add Images, and wether they are Featured Image, Types Custom Fields or in the Post body added with the Media Uploader, you can then display them in the Loop of that View with:
- Featured Image ShortCode
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-featured-image
- Types Image Field ShortCode
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
- Post Body ShortCode if the image was added within the Body.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This way you get the images related to your Posts.
Otherwise, you get all Images from the Library in a irrigated order.