Meta Box
Support Forum
Support › General › Shortcode to query all records of an object_id
Hi I created a CPT via MB named Agencies, added a custom field agent_code How could I create a Shortcode to query all the agent_code(s)? Something like: agentA, agentB, .... Thanks
Hello,
You can create a custom query to get all posts of a CPT then use the helper function rwmb_meta() or get_post_meta() to display the field value. Refer to the documentation https://docs.metabox.io/functions/rwmb-meta/ https://developer.wordpress.org/reference/functions/get_post_meta/
rwmb_meta()
get_post_meta()
Or follow this topic to get all field values from a specific key https://wordpress.stackexchange.com/questions/9394/getting-all-values-for-a-custom-field-key-cross-post