Well, you are using:
get_post_meta(get_the_ID(), 'subtitle', TRUE);
So, you are saying to WordPress to get the meta value of the ‘subtitle’ field and that the returned value be in format of string. See get_post_meta() docu.
To get all meta data of a post you should use get_post_custom() function instead. For example, if you are inside the loop:
$custom = get_post_custom();
foreach($custom as $key => $value) {
echo $key.': '.$value.'<br />';
}
This will return all meta data of the post. If you want to check, for example, the “price” meta field:
if(isset($custom['price'])) {
echo 'Price: '.$custom['price'][0];
}
Related Posts:
- How to retrieve custom field types for all posts in WordPress/PHP?
- Query & Order posts by custom fields
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- custom comments form for custom post type
- WebP Fallback for Inline Background Image in Style Attribute
- Warning: Invalid argument supplied for foreach() [closed]
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- How to store the third party script with HTML code in the wordpress custom input field?
- How to display custom field in product description?
- Problem with multi checkboxes value in metabox?
- Custom post type that lets users create a set of posts?
- WordPress is giving a warning but my code is working fine
- Search form to find custom meta box generated data
- Custom post type and custom taxonomy archive inaccessible
- Retrieve a post with its ACF repeater fields in wordpress
- Rewrite and custom post type: order by custom field not working
- add custom field to custom post type
- How to set up multisite for multi language?
- CPT Group by Date metabox Value
- How to check if user meta field is empty in conditional else statement
- Replace text in post from cvs
- Admin search ACF relationship
- wp_query check if integer exists in custom field’s array
- How can I dynamically add a post to a custom post type which uses a custom field?
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Custom Posts Types as Custom Fields
- Get image post ID in media upload
- Get term name and term parent into custom post type permalink
- Why is my select meta data not saving?
- dynamically add a custom field or metabox to custom post type [duplicate]
- Give a permalink to Custom Post Types without title
- Role scoping for contributors down to the field level
- How to implement a Google map store locator
- Creating a Custom Post as a repository for theme constants
- search also in taxonomy, tags and custom fields
- Random image from tag/custom type on sidebar
- How to stick custom post at the top in search results
- Allow non-logged in users to see a future post after clicking on a list of future posts
- How do I create custom fields for multiple post types?
- Add field to all custom post types
- Help need making decision. Ads rotating site on wordpress
- Filter custom posts using auto populated dropdown selectors
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Custom post type content using custom fields without template
- Cannot add custom field to “orderby” parameter in Rest API
- custom taxonamy and post type
- retrieve Meta field value from CPT and set those values as Image Meta Field “Title”
- Having unique constraints for custom fields in a custom post type
- Querying Two Custom Post Types with OR Not Working
- How can I get the number of custom post type posts that have a specific attachment image set?
- Trash / Draft a WordPress custom post after custom date field expires
- Set a maxlength for the title input in a custom post type
- Posting to a Custom Post Type from front end – user generated content
- Display custom fields from custom posts in RSS feed
- Bulk Update Custom Fields for Custom Post Types
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Visual editor issue by having multiple tiny mce editors in a CPT
- WordPress Custom Fields Won’t Save
- Update Post Meta for a logged in user
- Problem querying Custom post type by custom fields
- Return the latest post from a custom Taxonomy and Post Type
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Add custom field to Posts and sort by it
- Don’t know how to show custom taxonomies from a custom post_type
- Orderby CPT custom fields not working
- WP_Query order by custom field, then randomly order some of results
- A better way to add a meta box to custom post types
- Rows with custom columns not well formatted after Quick Edit save
- Plugin – Combine Meta Box Input Fields into single saveble record
- Two Custom Post Types Many to Many Relationship
- Show custom post type relationships by taxonomy
- get_post_meta not working on publishing
- Not Able to Get Custom Post Type Gallery Images URL
- Query custom post type with ACF Date
- JS innerhtml changing style when using AJAX
- Custom setting to show or hide field
- Custom Meta Field – Remove comma from string with str_replace
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Using custom field content as expression in IF statement [closed]
- Meta Query Not Returning Output Despite Having Matching Values
- How to create a custom post type with additional fields?
- Callback to custom field is not working in WordPress REST API
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Display a grid of taxonomy terms at root taxonomy page
- Including metaboxes from custom post types in global search — continued
- ACF From & To Date Validations
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Query Multiple Custom Posts by Custom Fields
- Show image gallery from a custom field
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- Dynamic dropdown select values depending on other custom field value
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- How to render a custom post type template with custom fields using shortcode
- Disable saving posts as draft (make all posts mandatory regardless of the post status)
- Grouping metadatas into one
- Tracking changes in admin-page so user gets warning when leaving the page
- filter custom post in rest api with custom function
- Get Posts by multiple custom fields is not working