Change $single
back to false
, e.g.:
<?php $name_text = get_post_meta( 65, 'name_text' ); ?>
If set to true then the function will return a single result, as a string. If false, or not set, then the function returns an array of the custom fields. This is not intuitive. For example, if you fetch a serialized array with this method you want $single to be true to actually get an unserialized array back. If you pass in false, or leave it out, you will have an array of one, and the value at index 0 will be the serialized string.
You want to return the array, and then use $name_text[0]
.
Related Posts:
- How to fix missing custom fields after upgrading to WordPress 4.8.1?
- Adding a custom field to the site identity menu
- How to correctly call custom field dates into a posts_where filter using SQL statements
- With WordPress Importer, why can’t I import post meta containing a multi-dimensional array, in which value(s) of that array contain line breaks?
- Save Custom Fields for Variations Product
- How to prevent custom fields from being cleared during a bulk edit?
- Archive sorting functions by custom fields (front-end)
- Custom fields are not restored to previous revisions
- Order by custom field date with ASC order
- Don’t display html if custom field is empty
- Adding a custom field into the_content()
- Determine when a custom field was last updated?
- Sorting within nested queries / multiple meta keys
- Ordering posts by anniversary using only day and month
- Using a custom field value to redirect away from a 404 page
- How to use pagination with get_post_meta
- Extra filed under “About the user” user profile
- How can I combine meta_query queries?
- custom field value date convert to unix timestamp problems
- Programatically import custom fields using wp all import [closed]
- Execute/Parse Shortcode in Native WordPress Custom Field Value Field
- How to save taxonomy term meta?
- Metabox image upload and custom field
- Can you ungroup Custom Fields?
- How to construct multiple meta boxes
- Force hide custom field metaboxes
- Redirect users based on custom field
- Order by custom field value not working for acf date field
- How to Validate Post Meta type/extension (Video File Image File etc)
- Custom Meta Box not Saving in Posts with Gutenberg Editor
- How can I pass a variable set by ACF to header.php?
- Update Custom post field by Ajax on cached site
- Meta query with timestamp using WP_query
- Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)
- Meta_query is not working on Elementor Custom Query Filter [closed]
- Add Custom Field to a template page backend
- How to create html block to display extra information on woocommerce single product page
- custom field not saved
- Run a check for multiple meta key values
- Getting the ID of any image for use in functions.php
- Auto-remove custom field with no value on publish
- How to schedule a custom field value update?
- Hide custom meta data if empty
- Advanced search for meta fields
- Woocommerce Product Custom Select List (not variation)
- How to find a post using XML-RPC without knowing ID
- How to get latest post value if first post is empty in wordpress
- Saving Custom Field Data before Publish
- Custom fields attached to a page template only show on edit screen when page is saved
- Populate Javascript code with value from WordPress Custom Field?
- Limit of char count in WP custom fields
- how to make nsfw post with thumbanil
- Specific coditional usage [closed]
- Can I access a post meta field before the loop?
- wrap text around custom fields array
- How to I make my post title link to a custom field
- Show image if author meta (profile fields) exists outside loop
- Google map that plot’s several markers – each one with custom data
- How can I check if a custom field was updated?
- Buik update custom field values from external API
- Get custom fields without _edit_last, _edit_lock, _wp_page_template and _visual-subtitle
- award points to a user each time they update their cpt post
- TinyMCE custom button retrieve value from custom field
- query_posts with meta_value
- Update post meta data (custom field) by post link
- Change a custom field value after X number of seconds
- Changing order in which custom fields appear in dashboard
- Let Users Filter Posts by Custom Fields
- How to get all custom fields with some prefix in key?
- Retrieving custom field value with get_post?
- Run Function if Order Meta Exists – WooCommerce
- Stripping and/or altering the content of a custom field (video URL)
- Custom field outside the loop and inside an array
- WP E-Commerce Custom Meta > Serialized array
- Display Additional Info
- Add link to wordpress field data
- Adding text box with add_meta_box
- Save Taxonomy of Post via custom Taxonomy Select Dropdown
- use custom field value as featured image
- (woocommerce) How to get product id form order id & then retrieve custom meta linked to product?
- Is it possible to manage Multiple Custom Fields with Some Relations
- Retrieving and inserting data in custom fields
- How to add custom fields to images for image source text and URL
- Custom Metabox Always shows box and checked
- Create custom query for search?
- Updating custom fields with external data
- How to disable ‘enclosure’ custom field link from appearing in the post
- Help sorting by Meta Key value
- Custom classes for attachments
- RSS Feed in Custom Field
- List custom field values in alphabetical order without repetition from the current category?
- Incorrect data after modifying post using backlink from wp_die
- Displaying shortcode content inside custom field without images
- How can I duplicate “Add Custom Field” with just JavaScript?
- How can I display only the post titles from a selected category in columns?
- Show or hide custom fields by user’s role [frontend]
- How to mark a image attachment as background image?
- How to automatically create a custom field when a post is published?
- How to display search query as formatted text?
- Problem display