I am trying to piece together a Metabox with 3 text editor fields for a custom post type.
The box is showing up and appears to be saving on the custom post type entries but I can’t get the data to display on the single-[custom-post-type].php page.
Most recently I have tried the following to get the meta box data to display on the page:
global $post;
$meta = get_post_meta($post->ID, 'my-info', true );
if ($meta != '') {
echo $meta
} else {
echo "Can't Display The Content";
}
I’m not sure if it’s a problem with my Metabox creation/save that I can’t get it to display. If anyone can point me in the right direction I’d appreciate it.
Here is a link to the code that I’m using for my Metabox if it helps:
To show post type meta data on a single page template, I assume that you’re in the Loop.
If you’re not getting any output, then you might want to check your complete set of post custom data:
Use IDs of fields to get meta data of respective fields as following code.
Some times id is not working then we can use name attribute.
For displaying meta box values your code must be in loop.
Here meta-box-text is name attribute of my input text field.
It works perfect for me.