I want to check if post meta key exists or not, out side of the loop. Is there any WordPress function to check if post meta key exist or not in WordPress database. I have to check this outside the loop. Any help will be highly appreciated.
In case anyone else stumbles across this old question like I just did, it looks like the best way to handle this is using
Here's what the syntax would be for post meta:
metadata_exists('post', $post_id, 'meta_key_to_check');
You could use get_post_custom(POST ID GOES HERE) which will return a multidimensional array with all custom fields of a particular post or page.
So something like:
$meta_data = get_post_custom(785); if ($meta_data['my_meta_key'] != "") ...
would allow you check if a particular meta_key was empty or not.