Problem:
I am trying to set up a view by url parameter. I have created the custom user field "test" that holds the ids of the posts but I do not know how to create the link that will output the ids in url.
Initially I used this code in the view template:
<a href="?test=[types usermeta='test' user_current='true' separator=',' output='raw'][/types]">show posts with ids same with the values from the custom field test</a>
The posts appear seperated by a comma in the url like:
domain.com/view-post-query/?test=1830,697,2167
and the view shows only the first post from the list
I visited this url:
http://ecommerce-wordpress.discover-wp.com/product-comparison/?post_ids%5B%5D=1170&post_ids%5B%5D=892&post_ids%5B%5D=795
Solution:
Please try this:
<a href="?test=[types usermeta='test' format='FIELD_NAME[]=FIELD_VALUE' user_current='true' separator='&'][/types]">show posts with ids same with the values from the custom field test</a>
And test again.
Relevant Documentation:
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.
Our next available supporter will start replying to tickets in about 1.24 hours from now. Thank you for your understanding.
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 6 years, 11 months ago.
Assisted by: Luo Yang.