Ok, since we’re going the post meta route (as opposed to options), there’s a much cleaner and efficient way to grab a post by it’s title:
if ( $info = get_page_by_title( 'Business Info', OBJECT, 'post' ) ) {
// do stuff
}
Don’t let the page in the function name throw you off – the third argument is the post type (in this case post).
Secondly, let’s find out what’s actually going on:
if ( $info = get_page_by_title( 'Business Info', OBJECT, 'post' ) ) {
echo '<pre>';
echo esc_html( print_r( get_post_meta( $info->ID ), true ) );
echo '</pre>';
} else {
echo 'Oh no!';
}
Report back with you what you get from the above debugging snippet.
Related Posts:
- How to get custom post meta using REST API
- What is “meta_input” parameter in wp_insert_post() used for?
- The “_encloseme” Meta-Key Conundrum
- Using get_post_meta with new_to_publish
- So much data in postmeta
- Can I count the number of users matching a value in a multiple value key?
- Auto sort the wp-admin post list by a meta key
- Allow user to create instances of custom field
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- Get updated meta data after save_post hook
- Save HTML formatted data to post meta using add_post_meta()
- Ordering posts by anniversary using only day and month
- How to break meta values into different items and avoid duplicates?
- ajax delete value from custom field array
- Save attachment custom fields on front end
- How to use pagination with get_post_meta
- Custom fields: In what order are they saved into the DB?
- Transition from (classical) serialized custom meta field to (gutenberg) rest enabled meta
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- Custom field value based on other custom field values
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- How to display Meta Field Value?
- MySQL query to set wp_postmeta using term_taxonomy_id value
- How to Validate Post Meta type/extension (Video File Image File etc)
- Custom Meta Box not Saving in Posts with Gutenberg Editor
- Combine multiple custom field values into single value
- How do I use wp_query for WordPress search?
- Nav Menu – Add class based on meta keys
- How to wrap meta values seperated by comma in ? [closed]
- Bulk remove post meta
- How to create html block to display extra information on woocommerce single product page
- Can’t get post ID using wp_insert_post_data
- Unique Post Meta Values
- Run a check for multiple meta key values
- WordPress Rest API to call page data associate with custom meta
- Store array as single, serialized post meta field or many post meta fields?
- Hide custom meta data if empty
- How to create a shortcode to print specific values stored in a post meta array?
- Add custom field to all posts in specific post_type
- Button inside Custom Meta Box triggering the Update Button
- How to load an assets based on custom field value?
- get_posts in meta box dropdown not showing latest posts
- Limits, not all post are showen when querying for posts by view count
- Display Custom Meta Box Field Only If Value is Present
- Ordering posts by custom field named “date” in backend
- Stop sending email everytime I updates my post
- Best way to store everyday post views?
- Unable to get specific value from post meta
- Custom meta is not being saved
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Let’s Create Custom Field Template Documentation
- Branch made by several custom values
- Looping inside block return
- WordPress creates new lines in postmeta table on post update
- change order of images attached to post
- User customising position of WordPress Featured Image
- how can I show name and value of Custom Fields together?
- Can I save post meta programatically without setting metaboxes?
- Insert image into sub-field with update_post_meta
- How to use conditional statement with custom field
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- Gravity Forms Update post meta from template [closed]
- Best way to achieve multiple links in a post title
- How can I add/update post meta in a admin menu page?
- Get author total post votes from post meta
- custom filed from post in the side bar
- wordpress multi user question
- How to display custom fields in hestia theme
- Adding Custom Metadata to my Archive/Posts page
- How to improve my non-unique metadata MySQL entries?
- How to speed up post list slowed by update_meta_cache()?
- WordPress Blocks, setAttributes not saving
- Custom Fields Not Showing (ACF not installed)
- SQL query to change the value of a Custom Field
- Custom meta POST request fired twice when updating a post in Gutenberg
- Add custom field information to source meta data
- How do I update custom field post meta in frontend post template?
- Update custom field on page specific to logged in user
- How to Find List of Available Custom Fields for Theme?
- Create Meta boxes dynamically
- Saved Post Meta Array Returns as String
- Delete custom meta
- Problem saving meta data
- Check if value exists before saving
- Get meta value when the page is a blog archive
- change attachment custom field onChange event
- wordpress simple post multi rating with post_meta and user_meta
- wp_postmeta are updated for only one page
- Custom fields / meta box output
- Use custom field value as href
- Make Custom Fields Public in JSON – API
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- Order by a meta field in query loop
- How can i put a custom field inside this php
- How to add new Metadata options (Date, Author, etc.) for Posts?
- Saving multiple custom meta box fields
- Search for meta_query does not return any result if combined with title
- What is the best way to get a different post’s custom field/postmeta with js?