It most probably means that no custom post values have been retrieved for the key Description
that you used. According to the Codex, Returns nothing if no such key exists, or none is entered.
Try adding print_r($key_values);
on the line just after get_post_custom_values("Description");
and check if any value is retrieved.
To skip this warning(when you don’t have any custom post values associated to a post), you should check if $key_values
is an array before doing the foreach
. And don’t forget to escape your double quotes.
if( is_array( $key_values ) ){
foreach($key_values as $key => $value );
echo "$key => $value(\"Description\") <br />"; #You should escape your double quotes here!
}
Related Posts:
- Query Posts or Get Posts by custom fields, possible?
- Using get_posts with arguments found in meta keys
- Loop through two different sets of custom fields
- use get_posts to get custom field data, but in one array
- Order posts according to user defined order for meta values?
- get_posts that match a user-specified value on a page
- If meta key exists in get posts function otherwise create it
- get_posts that haven’t been assigned a specific custom field
- Meta Query returns wrong number of posts
- How to find a post using XML-RPC without knowing ID
- get_posts in meta box dropdown not showing latest posts
- get post id using custom filed value
- Loop through incrementing custom fields
- Custom field to array?
- How do I display an article using a WordPress custom field?
- WP_Query – Order results by meta value
- Custom query with orderby meta_value of custom field
- Custom post meta field effect on the performance on the post
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- How to enable revisions for post meta data?
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Add custom objects/entities to WordPress
- Change behavior of “Insert into Post” based on attachment metadata
- Sort posts by custom field numeric value using dropdown
- How to position a custom field before the editor
- How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?
- Is there a way to do multiple ordering on a multiple meta_query?
- searching in custom meta field
- How to add upload field in a custom taxonomy?
- Display thumbnail from custom field
- Bulk move (or copy) from a custom field to the post content?
- Store JSON in a custom field
- Getting Custom Field data from a page hierarchy
- Custom contact form 7 select with custom values [closed]
- limit amount of photos uploaded per cpt post
- Problem with adding exta field in metabox in custom post type
- Best way to add custom / magic / flutter fields into RSS feed
- Setting orderby to a custom field using pre_get_posts
- Add WYSIWYG to Image Description field
- Calling custom profile fields?
- How to get multiple checkboxes in one meta field
- Adding Custom Fields to Search
- How to Display Custom Meta Box only on Specific Page IDs
- Get custom field label
- Show ACF fields only on certain page in the backend
- Custom Field Suite A little problem
- How make a custom search on backend in WordPress without plugin?
- Create Multiple File Upload Metabox in WordPress
- WP_User_Query pulling ACF to loop
- how to put a custom field value in variable
- How to add the image URL from an external RSS feed and insert into a custom field?
- My custom backend codes shows up when i try to view my website
- Advanced Custom Fields dynamic update_field
- Custom Profile Fields move from BBpress to BuddyPress
- How can I output a list of values for a custom field, and posts with those values?
- Add additional ‘description’ field for defined roles / role metadata?
- I need a “Choose from existing content” popin
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- Avoiding ACF get_field and returning to core WordPress function
- Walker class for sub-menu with ACF fields
- Display custom field value part by part?
- How can I hide custom field from users used for caching response from external api?
- How do i get the attached images with custom value checked?
- How to disable Edit Post and Allow only Custom Field?
- Cannot save underscore custom fields in one wordpress installation using xmlrpc and underscores
- Diamond question mark in text after migrating content
- Display posts with empty custom field
- Custom Fields Question
- Add custom data (field) to sidebar widgets for later display
- How do I convert all custom_field php timestamps in the database to js timestamps?
- Display custom field value as a mailto: link
- Display custom field only if it has a value
- Make separate text boxes for separate WordPress Custom Fields
- Sort by an ACF field in a tax_query
- Custom field metabox not showing in back-end
- Load one page with parent and child pages
- Why can’t I get the correct post permalink
- Use a different catalog image than the featured image
- Query Multiple meta
- Mathematical operations on custom field values? (updated)
- Ordering posts by custom fields
- How to diplay a div only if at least one author custom profile field is filled?
- Show message if statement is false – foreach
- Order by custom field in query multiple
- Returning website screenshot based on Custom Field
- Use Metabox to enter Post Title
- Include custom fields into the content of a regular page
- Bypassing a Form Options
- How to query posts that have certain post meta keys, and sort by meta key and/or value
- How to implement jquery-ui autocomplete into custom fields?
- i want to send email on custom post field (job_status == 2) but it is not working
- How to create a searchable database with a single-field search box at the front end? [closed]
- Add custom fields to specific menus
- How to apply Local Business Google Schema dynamically on a Custom Post single template?
- Add CSS class to posts with certain meta key
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP
- Best way for managing images of ads banners
- Crop custom image size vs actual size