You already have $post
object on image.php
. Don’t complicate and use following:
<?php
echo get_post_meta($post->ID, 'my-custom-field', true);
echo $post->post_parent;
You already have $post
object on image.php
. Don’t complicate and use following:
<?php
echo get_post_meta($post->ID, 'my-custom-field', true);
echo $post->post_parent;