hello, I'm sorry to keep posting but I am trying to display my Page's content and then underneath, show a link back to the Page's parent page (if it has one).
I have tried the following but I keep getting a link to the current Page.the title is correct though..
<div class="entry">
<?php the_content();?>
<?php
if (!empty($post->post_parent)) {
$parentTitle = get_the_title($post->post_parent);?>
<a href="<?php get_permalink($post->post_parent); ?>" title="<?php echo $parentTitle; ?>">Back to <?php echo $parentTitle; ?></a>
<?php
}
edit_post_link('Edit','','');?>
</div>
As you can pass an ID to get_permalink etc I thought I would be able to do $post->post_parent. Am I far wrong and is it ok to be doing this within the loop still??
Thank you for your time
JJ