I'm using a theme template and when i try to get post ID it returns the ID of the template not the ID of the actual single post.
the template ID is: 215 the post ID is: 1911 the following code will only output 215
function metavalue() {
global $post;
$meta = get_post_meta($post->ID, 'product_url', true);
return $meta;
}
add_shortcode('url_short', 'metavalue');
get_the_ID(); the_id(); $post->ID; will also output 215. i need a way to get the actual single post ID so i can get the custom field value from 'product_url'.