To show post type meta data on a single page template, I assume that you’re in the Loop.
// Use get_the_ID() to get the ID via the API function
echo get_post_meta( get_the_ID(), 'my-info', true );
// You can also call it from the global, as the query refers to the current single page
echo get_post_meta( $GLOBALS['post']->ID, 'my-info', true );
If you’re not getting any output, then you might want to check your complete set of post custom data:
printf( '<pre>%s</pre>', var_export( get_post_custom( get_the_ID() ), true ) );
Related Posts:
- Passing error/warning messages from a meta box to “admin_notices”
- Add “upload media” button in meta box field
- get registered metaboxes by post type or post ID
- esc before saving or before displaying does it matter?
- Add a meta description to home page?
- Check if meta key value already exists
- get_post_meta doesn’t work
- Metabox of one post influence setting on other
- How to store multiple input values with same meta_key
- Consolidate Metaboxes into 1 Big Metabox
- unable to save post meta on single field with multiple selects
- metabox upload file
- Why is variable value emptry in $_POST but available in $_REQUEST?
- Why does get_post_meta not work with the posts page?
- How to get meta box values – WP tuts tutorial
- Change the post date from a meta box
- update_post_meta and get_post_meta not working
- Repeatable custom meta fields
- how to save multiple checkboxes value in wordpress dynamically
- Using WYSIWYG In custom meta boxes
- Multiplicate entry on update_post_meta
- Undefined index error in custom post metabox
- Custom Meta box only returns most recent value on page
- How to prevent further updates of custom meta when using actions to set one meta based on another
- How to create a button click counter meta box?
- meta box & callback function
- $_GET & $post_ID
- get_post_meta as a list for drop down search filter
- Parse a text area custom meta box and assign as value to existing meta keys
- Getting metabox value?
- Hide Page Title with Post Meta
- Save meta data with post, Without using any plugin [closed]
- Editor meta box Showing but not saving
- How can i get multi checkboxes value in metbox?
- Show value of select dropdown in meta box
- remove a single post_meta
- Echo 2 values from one key in Array with get_post_custom
- save radio button selection in post-meta on submit
- post meta – problem : copy the same meta for all the articles
- Custom Meta Data is not being saved
- Update Post Meta in Front End with a form
- Update Post meta with custom variable
- get_post_meta not working on my custom-function page
- update_post_meta doesn’t work
- Removing Meta Generator
- Only allow one meta key value per post in a category
- use post meta in add_meta_boxes action
- Custom meta box not saving values of radio buttons in WordPress
- Can’t save drop down select date in meta boxes
- update_post_meta does not work
- add_post_meta not saved
- when saveing $meta_box i get Undefined index error
- Updating post meta and Meta Box plugin
- Related posts and custom meta_box?
- Select Options Meta Data is Not Updating in Edit Meta Box
- How to display meta box data using “Meta boxes as needed”
- Metadata in loops
- Allow iframe in custom meta box
- Calling Data from Custom Meta Box
- How can i remove blank area caused by theme’s post meta boxes?
- Datepicker altField and altFormat to save a new meta key/value in a post?
- My meta box don’t want to save value
- CPT posts in drop downed in meta box on page doesn’t return post ID
- How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button
- Removing panels (meta boxes) in the Block Editor
- Custom Meta Boxes: multiple fields within a repeatable field
- Remove metabox from specific page template in admin
- Is there a filter/action to add content to WP admin metaboxes?
- Attach Files Metabox
- How do I create a meta box for dates?
- Adding an assisting editor box to Post page
- How to insert Gallery shortcode to a meta box
- Display list of tags as drop down menu or radio buttons in a meta box?
- How to List all Sidebars in a Metabox
- How do I migrate meta boxes from the Classic Editor to the “side area” in Gutenberg Editor?
- update a post meta from a single table cell TablePress
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- Undefined ‘post_type’ error on Add new page
- metabox wordpress show in frontend
- How to modify Publish metabox?
- Controlling Meta Box Height
- how can i do metabox [closed]
- How to add meta box for image upload using WordPress media uploader?
- WP nonce field checkbox prints checked=’checked’ outside input field
- Meta box data not saving
- Show button if meta box has content, else hide
- Custom meta boxes ID prefix showing on first category but not others
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- put saved metabox values back into fields and then display on the front end
- Checkbox in post not saving value
- add post meta front end edit
- how can I make this metabox area
- Metabox with checkbox is not working true!
- Displaying a Metabox linked to post settings for all users
- Can’t get meta values to save
- Error when adding Meta Boxes, but only when adding 3 with the same callback
- Delete custom post type metadata without deleting the post in admin area
- Display Data From This Custom Media Upload Meta Box?
- Adding meta boxes to custom post type