Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How can I display my custom metaboxes on a custom post template?

Looking at your code, it appears all meta keys are prefixed with _cmb_. Your start time key is text_datetime_timestamp, so combined with the prefix, you want to fetch:

get_post_meta( get_the_ID(), '_cmb_text_datetime_timestamp', true );

Note the third parameter, which will retrieve a single value if set to true, as it’s possible to save multiple values under a single key, which would result in an array of values.

The simplest way to see all of the keys your meta data is saved under, is via get_post_custom_keys:

$custom_field_keys = get_post_custom_keys();
foreach( $custom_field_keys as $key => $value ) {
    echo $key . " => " . $value . "<br />";
}

Put that in the loop and it will tell you the names of all of the keys your meta data is saved under.

Related Posts:

  1. Custom Meta Boxes – Nonce Issue – Move to trash issue
  2. Show metabox in custom-post-template depending on taxonomy term?
  3. Displaying Metabox value (custom post type taxonomy)
  4. Metabox not show in categories custom post type cmb2
  5. Custom Post Type meta data getting deleted on bulk editing taxonomies
  6. Advanced search form with filters for custom taxonomies and custom fields
  7. Remove Custom Taxonomy Metabox from Custom Post Type Screen
  8. Custom Taxonomy as checkbox or dropdown
  9. wp_dropdown_categories in custom post type with custom taxonomy
  10. Changing the priority of a custom taxonomy’s metabox
  11. How do I remove all the metaboxes for a custom post type?
  12. WP_List_Table Inside Metabox Not Working on Submit
  13. Find callback function for custom taxonomy metabox
  14. Get all posts from custom post type and insert in select input as metabox
  15. Detect meta value changes when post is updated (post_updated)
  16. Unable to save custom taxonomy terms in a custom-built metabox
  17. How to select one major category (or custom taxonomy) for a custom post type?
  18. Having trouble with custom post type / meta box
  19. How can I include meta box content when searching?
  20. update a post meta from a single table cell TablePress
  21. update custom post type meta from a shortcode
  22. Displaying Meta Box Image
  23. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  24. How to add multiple featured image in meta box in post editor?
  25. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  26. Displaying custom posts only if custom meta box’s date is not expired
  27. Meta Box Only in CPT Edit Page, Not in Add New
  28. get_post_meta is returning image id
  29. need advice on how to do a lists using custom post types – taxonomy vs postmeta
  30. Count posts with specific term_meta
  31. Does WordPress limit the length of slug names for Post Meta or Terms?
  32. Populate Custom Fields in a Custom Post Type?
  33. Custom meta box data array: foreach not working correctly?
  34. Undefined Variable – Custom Post Type Meta
  35. Populate dropdown from one custom post type inside another custom post type
  36. How to check if user meta field is empty in conditional else statement
  37. How to duplicate entire custom post type
  38. A better way to add a meta box to custom post types
  39. Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
  40. Show Custom Post Type meta boxes only on Page Edit
  41. How to make custom taxonomy into drop down select in a custom metabox
  42. Ordering values entered in Custom Taxonomies
  43. Listing custom terms in custom post meta
  44. Permalinks: custom structure for taxonomy – tags?
  45. Can’t publish custom post type – “You are not allowed to edit this post.”
  46. Meta Data for Custom Post Type not saving
  47. create custom meta box with default value
  48. Displaying a div from an assigned meta_value when on a page
  49. Display different information of a custom post type
  50. How to Echo Metadata Value in Currency Format
  51. Issue on Working with Metabox – Checkbox to enable Sale Items
  52. Filter posts by tax (dropdown) and meta value
  53. Why do I have to press the “Update” button twice to save my meta box values?
  54. how to show records that don’t have custom meta value
  55. Values from meta-box not on $_POST
  56. Custom post type suddenly stoped working after WordPress 5 update
  57. Removing numerous Meta boxes from numerous CPTs
  58. Reusable metabox backend and frontend
  59. Get custom term meta problem on single post type
  60. How can I output WPAlchemy repeating fields meta values in my page template?
  61. Meta box data is saved but NOT displayed in the meta box text field. Why?
  62. Save Metabox Custom Field Value
  63. Meta box data not saving
  64. WP_Meta_Query object with conditionals
  65. Related posts meta_query CPT
  66. Meta box with front-end styling
  67. Sanitaizing Select Optin For Custom Post Type Metabox in WP
  68. How to retrive Custom Post Type Meta Fields in Custom WP_Query
  69. Cannot Save MetaBox Data in Custom Post Type
  70. Add a class to post_class if more than one post shares same meta_value_num
  71. Function to return values from metabox
  72. Add a meta field to the list of results for a custom post type
  73. best way to use custom taxonomy, post type and meta in a job system
  74. Empty meta-box returns publishdate if no value is set?
  75. Custom Meta Box with variable number of fields
  76. WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
  77. Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
  78. PHP Warning with Custom Fields
  79. Get meta values from parent post and save in child post
  80. Custom taxonomy with custom post type archive page
  81. Add other all taxonomies as meta boxes to custom post type
  82. Saving Child Terms on front end not setting parent
  83. Order posts by meta value hiding posts instead of re-ordering
  84. Metaboxes in Loop
  85. Custom meta box data not saving
  86. Collect custom post in a calendar
  87. Delete custom post type metadata without deleting the post in admin area
  88. Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
  89. Problem with ‘save_post’ hook not running
  90. WordPress custom post type
  91. Custom meta-box for all custom post types
  92. Edit post meta direct from post.php?
  93. Add different meta box based on taxonomy
  94. Howto: use existing post_meta as options for a different metabox (checkboxes or list)
  95. Values inside a custom field to determine which category posts to display
  96. Display a post count from a custom metabox selection
  97. Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
  98. Advanced search form with filters for custom taxonomies and custom fields
  99. Post AND page parameter for WP function
  100. Use a Variable in update_post_meta as the $meta_key
Categories custom-post-types Tags custom-post-types, custom-taxonomy, metabox, post-meta
Buddypress: Edit activity when new blog post [closed]
Conditional based on the User Role of the Current Profile the user is viewing – BuddyPress [closed]

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress