You can get it by calling global $wp_query and assigning post->ID to a variable.
<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'top-headline', true);
?>
Related Posts:
- Limit the number of acf content when displaying in post loop [closed]
- Get meta value when the page is a blog archive
- Order by a meta field in query loop
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- How to enable revisions for post meta data?
- Best way to programmatically remove a category/term from a post
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- Storing meta fields multiple times OR once with multi dimensional array?
- display specific custom fields
- passing argument to get_template_part() or a better way to code
- Is it possible to store arrays in a custom field?
- Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
- importing data from non-wordpress mysql db
- Order posts by custom field and if custom field is empty return remaining posts
- Is it possible to sort the post based on a custom field?
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Unable to save datetime custom meta field using update_post_meta() function
- Create custom field on post draft or publish?
- get_post_meta fields don’t show up on posts page
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- Add a post meta key and value only if it does not exist on the post
- Move value of one custom field to another
- Order posts according to user defined order for meta values?
- Function to change meta value in database for each post
- Get a post_id where meta_value equals something in a serialized meta_value field
- Get aggregate list of all custom fields for entire blog
- Calling custom fields for pages (not posts)
- Duplicate posts being displayed when querying Custom Fields
- using multiple meta_key and meta_value in query_posts
- How can I sort homepage by a meta value?
- Get specific custom field keys from a post and put into an array
- Loop to display random posts only if a custom field matches category
- MySQL Query that looks for post with Custom Field, then changes Category
- ACF: How to get the full field name (meta_key) by a field key?
- get_posts that match a user-specified value on a page
- Meta Key Value in current-user-only loop
- Create Multiple File Upload Metabox in WordPress
- filtering custom post types via meta data drop down
- How to add a new meta key and assign timestamp to posts
- If meta key exists in get posts function otherwise create it
- Read / Watch / Listen times – meta
- How do I Implement Atomic Update of Post Metadata?
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Why is my Custom Meta Box Field Inputs NOT saving?
- Get registered custom fields or post meta even if empty
- Displaying multiple URLs as custom field values
- Change the main loop WordPress impact on the server?
- Stop sending email everytime I updates my post
- Best way to store everyday post views?
- shortcode in a custom metabox
- How can I modify RSS item titles to be either the title or a custom meta field?
- Avoiding ACF get_field and returning to core WordPress function
- Problem with saving large amount of data in postmeta/usermeta
- How to get posts with a metadata numeric key greater than X?
- Get all the posts where meta field with multiple choice has several values checked
- Move Title and the Content WYSIWYG editor position
- Can’t query by meta_key
- How do i get the attached images with custom value checked?
- Update post meta custom field using block editor
- Display posts with empty custom field
- Why am I getting a “Call to member function format() on a non-object” error?
- do_shortcode close
- Search Results Page – Displaying Custom Meta Fields
- If metabox has content display content
- Modify custom field from front end
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- Footnotes in custom fields
- Create a new custom field for all posts based on current custom field
- Display Meta Data with HTML?
- wordpress get_post_meta / the_meta to output custom field value
- How to show content of custom fields in search results?
- Group Posts By Custom Meta Value: Date
- Meta field bulk editing no longer working in WP 6.0 [closed]
- update_post_meta not working well
- get_field values for each post on home page using wp_add_inline_style
- Set class if a meta value is set within post archive
- How to add a post’s view count into the WordPress API response
- Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Allow HTML in Custom Metabox area
- Custom field metabox not showing in back-end
- Save, update, get and sanitize post meta as HTML not plain
- Custom meta boxes – add php code inside?
- Is it possible to sort the post based on a custom field?
- Metabox value for post loop?
- Saved Post Meta Array Returns as String
- Query Multiple meta
- Problem saving meta data
- Query postmeta values, and return multiple post_titles for common meta value
- change attachment custom field onChange event
- WP_query returns error when used for custom widget
- Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete
- Filtering posts by WORD in custom field
- Make Custom Fields Public in JSON – API
- Retrieving custom field as shortcode
- Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)
- How to add new Metadata options (Date, Author, etc.) for Posts?
- Saving multiple custom meta box fields