You have to add this line to the top of single.php
global $post;
or, use get_the_ID()
, as Divi does in the same single.php
if( get_post_meta( get_the_ID(), 'store-url', true) !== '') {...
Related Posts:
- Most efficient way to get posts with postmeta
- How to update_post_meta value as array
- What’s the point of get_post_meta’s $single param?
- Get a single post by a unique meta value
- advanced custom fields update_field for field type: Taxonomy
- update_post_meta not saving when value is zero
- Trying to get custom post meta through Jetpack JSON API [closed]
- Why time functions show invalid time zone when using ‘c’ time format?
- Why is get_post_meta returning an array when I specify it as single?
- delete unused postmeta
- Add post meta based on another post meta value before publish post
- WP REST API “rest_no_route” when trying to update meta
- delete value 0 in post meta [closed]
- Can I safely delete a record, manually, in the wp postmeta table?
- What action hook updates post meta?
- Exclude a category from the filed under list
- How do I access post meta data when publishing a new post in Gutenberg?
- Using Advanced Custom Field (ACF) to insert meta description on each page
- Are multiple values from get_post_meta guaranteed to be ordered?
- Add a post metadata if only the key and value does not exist
- Metabox Data not being saved [closed]
- How can I get values using key in Carbon Fields from Multiselect?
- WordPress Action Hooks and Post ID?
- Options to get my custom post type metadata via the WordPress API
- Generate an Email address from that of the Post Author
- Get page->parent’s name?
- How to get the total number of meta_values based on a custom post type?
- conditional function to change post-meta background image
- Does “update_post_meta” check if value is the same before updating?
- Custom meta field don’t give me numerical value
- how to get all post with the same post meta?
- Update Line Item Meta Data – WooCommerce API
- Echo page title from page with custom meta datetime picker
- MySQL Query To Select Post By Postmeta
- Unset field from an array not working as expected
- Update post_meta with WooCommere variation data
- Copy content stored in meta to post content
- How to programmatically customise the Contact Form7 notification email prior to sending? [closed]
- Saving repeated option values when querying in Published, draft and all
- How to hide meta block(s) in certain post format
- What type of index should I use for postmeta?
- Get a row from a separate table by matching a posts meta_key to a tables ID column
- need some assistance with the checkboxes (selecting/deselecting featured posts)
- get_post_meta() not work for the first post inside the loop
- Adding new value to existing meta key
- Save post meta foreach loop
- Should I save this mulit dementional arary as one post meta?
- How to check if a post meta key/value pair already exists for a specific post
- Reset/delete post views meta/custom field after X hours or minutes or seconds
- Remove last character in get_post_meta
- mass delete posts based on metadata
- Have lots of meta for posts, is it better to get at all at once or each individually
- Query posts WITHOUT a custom meta field
- How to obtain a group of post meta and assign each meta to other variables?
- Add box with custom per-page properties
- get_post_meta not working when variable used for post ID
- Update post meta dynamically
- Duplicate rows in meta table, any known relations in WC?
- Adding Custom MetaData
- update_post_meta in loop changing ALL values
- Is it safe to add a new field to meta_value field?
- Need a SQL query to update meta_key=’_price’ with value in meta_key=’_regular_price’
- Display current user’s custom post meta in sidebar
- Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?
- add_post_meta doesn’t work
- How to get single value from get_post_meta() array of values?
- How can I use ‘orderby’ => ‘meta_value_num’ to order by the numerical value even if the value starts with a word?
- wordpress update multiple posts post meta
- get_template_part() isn’t loading author information
- get Insert id for meta field
- How do I add a fixed value to get_post_meta();?
- Is there a way combine posts meta_name?
- Add post’s category as a meta tag to the post
- Format meta_value [closed]
- Is duplicate `_wp_attachment_image_alt` meta key allowed?
- Count Post and Page Views based on meta_value Using Shortcode in Dashboard Widget
- How can i set media attachments to the author of the post or page for already existed posts with attachments
- Removing Malware
- How to get posts by meta value as multi-dimensional array?
- After updating the custom post type, metafields disappear from the post.php edit menu, how do I fix it?
- URL from get_post_meta() is broken my URL
- How to modify default meta link format
- get_post_meta and add_post_meta not working
- Export media library with metadata and import into new blog
- how to query posts using value in meta post array
- Multiple meta key and value search in the query
- Re-pointing images to cloud storage
- Custom Meta Fields that are Echo’d are removed on post update?
- How to add dynamic content in title and meta description in wordpress theme for homepage, post page, category, tag and pages
- undesrtanding get_post_meta function
- Retrieve posts from meta key
- Assign postmeta in bulk
- Re-order posts inside tax query
- Using mysql queries to delete custom post types based on meta_value
- Write query according to post_meta
- Why values dont shows in custom post column?
- get_post_meta of multiple posts?
- I am stuck between post meta function to call unique id
- query with custom field
- Using Form to alter PHP variable [closed]