Skip Navigation

[Resolved] display distinct values of custom field in a view

This support ticket is created 6 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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, 8 months ago.

Assisted by: Beda.

Author
Posts
#559093

I am trying to: display only distinct values in a view

Link to a page where the issue can be seen: hidden link

now display : tv,tv,product2,rentcar,tv
But I'd like to display different values ( "tv" is repeated three times. )

I expected to see: tv , product2 , rentcar, car

Insoo

#559144

I assume this is a View that queries a certain Post Type, to where a certain Field with values TV, product, and so on, is assigned.

The View will produce a loop, and in that loop, all posts will be rendered.
For each Post, all the fields you call by ShortCodes will also be rendered.
Hence, it is the correct output.

If you want to show each field only once, despite how many posts there are in the Loop, you do not have to use a Loop.
You can either display the Post Fields outside the Loop (just above or below the <wpv-loop> tags) or, you can fully neglect to use a View.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.