Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.27, meta_query, shortcode
- This topic has 5 replies, 2 voices, and was last updated 7 years, 11 months ago by
Steven Zahm.
-
AuthorPosts
-
09/07/2018 at 3:55 am #471803
Tung Phan
GuestHi,
I’ve read document about using shortcode to show list data, and I know that the list can be filtered by category or some attributes
( https://connections-pro.com/documentation/shortcodes/shortcode-connections/filters/).But can I filter it by my custom field? For example:
[shortcode my_custom_field=”my custom value”]
Waiting for your reply.
09/07/2018 at 9:41 am #471834Steven Zahm
Keymaster@ Tung Phan
yes, but is complex. Here is an example:
[connections meta_query='{"meta_query":{"0":{"key":"Membership Type","value":"Golden","compare":"="}}}']
Capitalization matters. ChangeMembership TypeandGoldenso it works with your dataThe
keyis the Custom Fields Name and thevalueis the Value in the Custom Fields.Hope this helps!
09/10/2018 at 3:09 am #471979Tung Phan
GuestThank you for your reply!
I tried your code with custom-field which is created by default Custom Fields section and it’s work!
However when I created custom-field by adding code
(https://connections-pro.com/2016/03/27/quicktip-custom-field-checkbox-group/)
It does not run…
So do you have any suggestions?
09/10/2018 at 1:24 pm #472035Steven Zahm
Keymaster@ Tung Phan
Sorry, but this will not work with a checkbox group custom field. Only text fields. The reason is that the way the data in the database needs to be stored. The data for a checkbox field is not saved as text which can not be used with a meta_query.
09/10/2018 at 11:17 pm #472066Tung Phan
GuestThank you a lot! I will try some another ways
09/11/2018 at 8:58 am #472109Steven Zahm
KeymasterThanks!
If you have a moment, I would truly appreciate a review as they really do make a difference.
https://wordpress.org/support/plugin/connections/reviews/
Thanks in advance for your time!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
