Skip Navigation

[Resolved] Create a view displaying the value of one field from all posts

This support ticket is created 4 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 4 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1545901

My site allows the public to contribute posts. When doing so, they fill a custom field listing their name. I would like to list all contributors to the site in one place.

Can I create a view which will:
- go through all posts on the site
- pull the value from the 'Contributor' custom field from each post
- remove duplicates
- display what is left in an alphabetical list

Thanks!

#1546439

Hello,

There isn't such kind of built-in feature within Toolset, you might consider custom codes, for example this thread:
https://wordpress.stackexchange.com/questions/196262/list-all-unique-custom-field-values

#1546599

That's a shame, but thanks!
Just to check - would I be creating a view with this code? I wanted to display the list in a widget, but don't think I can use code in there, no? Do I need to create a view with this code and display this view as a widget?

#1546645

Since it is a custom code, Views does not support those custom codes, you can create a shortcode with custom PHP codes:
https://codex.wordpress.org/Function_Reference/add_shortcode

Then display above shortcode into a text widget.