Inside of my WordPress theme directory I have a standalone PHP file called image, this currently looks like this....
<?php
define('WP_USE_THEMES', false);
require('/home/mysite/public_html/wp-blog-header.php');
?>
<?php
global $post;
$post_id = 288;
$header_image = get_post_custom_values('caption', $post_id);
echo get_post_meta($post_id, 'caption', true);
?>
When I visit this site I want it to return the custom field value for 'caption' but I am getting nothing. I realise this page is outside of the loop but I thought I have included the wp-blog-header.php that it needed. Can anyone help?