Skip Navigation

[Resolved] Why do fields values display many times on a View in the front end?

This thread is resolved. Here is a description of the problem and solution.

Problem:
I create a View, and added a ShortCode for the Post title and a custom field to the loop.
When I insert this view and look at the results, I see the Title and fields repeating many times.
I want it just for one post.

Solution:
Views is used to create lists and hence as an offset and limit setting in the View's settings, where you can control how many items to output.

But, a View basically is a Loop, where you go over all posts and display for EACH post the contents.
If you want to display Title and Fields just once, you should consider using a Content Template instead of a View.

Relevant Documentation:
https://toolset.com/faq/whats-the-difference-between-a-view-and-a-view-template/

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

Assisted by: Beda.

Author
Posts
#619176

Hi,

I'm trying to display an "automatic menu".
In my real estate list of property, each one has a city.

I'd like to create a view I could place in a WP-Views widget to generate an automatic menu item each time a new city is added and more useful to display only once the same city.

So I have 2 houses in Washington, 6 in New York, I'd like my output of my view is only New York and Washinton and not 6 times New York and 2 times Washington.

Is it possible ?

Thanks for the help.

Best regards

#619346

What is "City"?

This is crucial to know so to buold a solution.
Is it a Post Type? A taxonomy? A field?

Probably a Custom Single Line Field?

In that case (any field) it's not possible to output this sort of "menu" with native Toolset features.
You could create a taxonomy View - if it were a taxonomy, and hence re-used.
Or, if it is a Post Type, simply the Posts (as they would be unique too).

But fields are stored against each post as a new value, and you could display a custom search for them, for example.
This way the value also is shown just once.

But in a Post Loop, it will be shown for each post in the loop, hence repeated.