If I understand your question correctly, you would like to get all metadata for “products” across all posts. In other words, multiple posts have metadata with key “products” and you want to get those values. If this is correct, you should use get_post_custom_values
, which is well documented in the codex: http://codex.wordpress.org/Function_Reference/get_post_custom_values.
As a side note, are you using the Meta Box API for your meta boxes. If not, you definitely should. I’d recommend taking a look at these two articles to get started with meta boxes:
http://codex.wordpress.org/Function_Reference/add_meta_box
http://www.wproots.com/complex-meta-boxes-in-wordpress/ (In the interest of full disclosure, I wrote this and it is completely on topic)
Related Posts:
- Can I query custom meta data through WP_Query
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- WP doesn’t show Array Custom Fields?
- How do I search an array stored in a custom-field using WP_Query?
- Is it possible to store arrays in a custom field?
- use get_posts to get custom field data, but in one array
- Saving an array in a single custom field
- Get specific custom field keys from a post and put into an array
- WP Query Returning All Posts
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- Run a check for multiple meta key values
- Create an Array of Specific Custom Post Meta
- Remove Body Classes
- Sort alphabetically by custom field
- change order of images attached to post
- query_posts with meta_value
- Displaying an ACF list of users
- Meta value Array
- Custom field to array?
- Show array of meta_value in Edit Post Coloum
- How to Convert Custom Fields from Text to Array?
- Custom field outside the loop and inside an array
- Working with multiple values and metaboxes
- Custom Field: how to save array of multiple key-values in WordPress
- How to save array option as text and not integer?
- Should I store arrays in custom fields or create custom tables?
- How do I use foreach to get content from a custom-field in multiple posts?
- Adding custom field to an array
- How do i output images from URL’s added to the same custom field key
- Extract array from custom field
- Build Array from Input Fields question
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- Underscores in custom fields
- Add custom field to the archive page?
- Need small coding with Custom Fields Search
- Adding Custom Field to Taxonomy Input :Panel
- How can I remove fields in the attachment editor?
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to store the value of a custom field dropdown select for post referencing?
- Custom bulk action for media gallery items
- WordPress Search Custom Meta Field Only
- Localized Date Format for Custom Field
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Saving custom image meta fields
- Echo values from custom field outside loop php
- How to add content at the end of posts?
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Complex WP_User_Query call fails on production server
- Query post order by post and desc not working
- If category then echo a custom fields
- wordpress custom fields multiple data
- How do I define post titles as images using Custom Fields?
- How to show Small Box Inside Content Area, which holds (text, images, links)?
- Sort custom field by post
- How to order posts by one custom field and filter them by another one?
- How to create a gallery custom field for WordPress post?
- Why the pagination for a query modified by pre_get_posts doesn’t mind the number & order of posts sorted & selected based on a custom date time field
- Trying to update_post_meta function
- How do i add custom fields to my themes template file?
- Custom Field to a Role?
- List users by sum of all their posts’ custom field values
- Duplicate (or more) custom fields on many posts. Is there an easy way to clean them up?
- How to pass page as an argument like post in WordPress?
- Sort WP_Query with numeric custom field
- Select custom posts by meta_value and sort by a different meta value
- Front end register with custom fields
- Enable a short code in the custom meta field
- Automatic linking terms
- Adding extra fields to front end signup form
- Problem uploading different files as custom fields with front end post form
- How to change order of posts in admin
- Custom product fields in wp e-Commerce plugin [closed]
- custom filed from post in the side bar
- Unable to select image with custom field
- Rewrite comment form post ID on submit
- Move the metaboxes to the very top of post editor
- WordPress Rest API custom field not updating till i manually update the post
- search based on custom field
- Custom Fields not working properly
- add meta box considers the selected option as post parent
- Custom fields multiple commas separated values
- How do I display a custom field in an existing form on the front end?
- Add custom field information to source meta data
- Delete custom meta
- Dynamically generated Navigation Diagram using Custom Fields
- Display custom fields only if it has a value
- Add nofollow to custom field link and make domain exceptions?
- wordpress simple post multi rating with post_meta and user_meta
- Custom fields are not displaying in page with multiple loops
- Add class from custom field into widget class
- Get multiple posts with some custom fields efficient
- Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data
- Meta boxes not displayed, data isn’t being saved
- Custom fields / meta box output
- Custom registration form and custom field
- Get single image from custom fields made with WCK custom fields creator
- How to add google map to custom field
- How can i put a custom field inside this php
- Add CSS class to posts with certain meta key
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP