If you remove the line global $post;
(and really you should remove it), there is no reason this shouldn’t work, according to the official documentation, unless as @rudtek mentioned, you run a custom query somewhere and the $post
has changed
Related Posts:
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to add meta box to backend menu page
- How to add multiple images to a custom post type single post?
- How to add multiple images to custom post type?
- Listing Pages With Checkboxes In a Metabox (and saving them)
- How do I remove all the metaboxes for a custom post type?
- How To Set Custom Post Type Title Without Supports
- Creating a Custom Post Types dropdown in a Meta Box
- Get all posts from custom post type and insert in select input as metabox
- Add pre-existing meta box to new custom post type
- Dynamic page.php template for custom post types
- Add comments meta fields to comments metabox on post edit screen
- WordPress metabox file upload in custom post [duplicate]
- Use Custom Post Type as Custom Field
- Saving multiple Metabox contents
- Display metabox conditionally
- Embed ‘New Post’ Form Inside ‘New Post’ Form
- How to stop wordpress from mangling HTML in a metabox textarea
- Relate two custom post type using meta box
- Hiding Metabox from Screen Options Pull Down
- How to: add option to add more checkboxes on custom post type
- how to set default value for checkbox in wordpress
- Timepicker-addon doesn’t show – Datepicker works fine?
- Metabox Populated with a Custom Post Type – How to Output CPT based on Select?
- Is it possible to create a post using a metabox?
- How can I show/add/save custom metaboxes as an Array of values?
- WordPress custom meta field for custom post not storing data
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- How to Duplicate (multiple meta box)?
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Save an array from drop-down in custom meta box
- Custom meta box not saving
- Push metadata in array
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- dynamically add a custom field or metabox to custom post type [duplicate]
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Custom Post Type uses Custom Tags in add_filter?
- Getting Custom Post Type Meta on Publish
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Adding a metabox on a CPT’s submenu page
- Checking if $_FILE isset for an array of file upload metaboxes
- Ordering values entered in Custom Taxonomies
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- Sizing textarea field in custom metabox
- Custom Post Meta from custom metaboxes is randomly being deleted
- Custom post-type metabox position
- How to add editable/dynamic values to dropdown of a Custom Post Type Meta Box
- wysiwyg editor don´t export paragraph
- How can I set a meta value that will then affect other post meta values?
- Inefficient Query Confusion
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- link featured image to external link
- Get custom term meta problem on single post type
- Is it possible to sort metabox teaxtarea values?
- wp_editor for custom post type doesn’t save value
- Showing a meta box in a custom post type on a page
- Having Issue on Getting Metabox Checkbox Value
- Multiple wp_editor instances in custom post type using Ajax
- CMB select with data from CPT
- Updating post content and custom fields in edit post screen
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- List of all posts in one custom post type in the edit screen of another
- Create a custom post type based on ‘Post’
- How do you make relational post types in WordPress? [duplicate]
- Placing Admin Post Metaboxes in Tabs
- Wp Meta Query does not work while simple Query Works
- How to Grab Anime info using Jikan API and fill the value in Metabox
- create a “add icon” field in taxonomies page
- Problem with multi checkboxes value in metabox?
- Getting data from dynamically allocated metaboxes within a custom post
- Get meta values from parent post and save in child post
- Using meta boxes as the title of a custom post type
- check_admin_referer not working in custom meta box for custom post type
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Convert Custom Post Data to Javascript Array for Autocomplete
- Generating Custom Post Type list, within admin of another custom post type
- Custom meta box in editor of custom post type not working
- Avoid another meta box in my custom post type
- Meta box not saving
- CPT and metabox: create multi checkbox by using array?
- How to make post page unique and show it on home page?
- How can i embbed two different galleries in custom post type
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom sortable pages on custom post type
- Toggle a metabox based on a selection
- Add multiple custom meta boxes to different custom post types
- Custom post type Featured Image popup not working
- How to bring custom meta boxes to custom post types?
- Custom post type in submenu with custom meta box as a title with custom html
- Problems with a custom meta_box
- CPT Metabox with email notification
- Move title “meta box” in post mode
- Cannot change meta box position
- Just the First Metabox what saves the data!