Tell us what you are trying to do?I cannot display single element of array
Is there any documentation that you are following?
Is there a similar example that we can see?no
What is the link to your site?hidden link
Hello, let me run some tests locally and see if I can reproduce this same issue. I'll give you an update shortly.
I'm not able to replicate this easily with repeating fields created by Types. I'm sharing screenshots here for you to review my setup to see if something is off. Can you share more information?
- How are these custom fields are created - a 3rd-party plugin? Custom code?
- How is the information stored in the database in the postmeta table? Are there multiple entries for repeating values, are the values serialized in a single entry, or some other notation? It might be helpful if I can see the repeating values from the database in a screenshot.
I emailed these to you 2 days ago?
Okay thank you for providing more information about the database storage system. It seems that the fields Questions_CF and _advads_ad_settings were not created by Types, and are stored in the database in a serialized structure. The Views shortcode wpv-post-field is not designed to interpret serialized values from the database, only simple values. The "index" attribute available with wpv-post-field works with some repeating Types fields because they are stored using multiple entries in the postmeta table, not a serialized structure in a single entry like these fields. So to display individual values from a serialized array structure, you would need to write custom code to retrieve these serialized values from the database, unserialize them, and display individual value(s) on your site. The wpv-post-field shortcode should only be used to display custom field values stored in an unserialized format.
I did a quick search and found this StackOverflow thread that discusses one approach for unserializing a single postmeta value stored in serialized format:
https://wordpress.stackexchange.com/questions/18463/how-to-extract-data-from-a-post-meta-serialized-array
You could use that example in a custom shortcode to analyze serialized values and return some indexed item from the serialized array:
https://codex.wordpress.org/Shortcode_API
Another ticket here in the forum has an example you can customize for your needs: https://toolset.com/forums/topic/custom-meta-with-multiple-values-in-views/
Let me know if you have questions about setting up such a shortcode.