Get meta information from post parent
So I am in a single page and I want to get some meta information from a parent page. This code is inside my footer.php:
if (is_single()) {
global $post;
$parent = get_post_achestor ( $post-ID );
$some_value = get_post_meta( $parent, 'some_metabox_param', true);
}
It's not working people, can you please have a look?
UPDATE: the parent page in question is template that has this loop
?php query_posts( 'post_type=postposts_per_page=5paged=1' );
if ( have_posts() ) : global $more; ?
div class="items"
?php while ( have_posts() ) : the_post(); $more = 0; ?
?php get_template_part( 'content', get_post_format() ); ?
?php endwhile; ?
/div
?php endif; ?