Custom post type – parent and child link
-
Hi. Thank you very much for this wonderful plugin.
I am trying to add a link that will show children if the post has children, and show the parent if the post is a child.
I am not skilled in php-coding and i have only come to what is beneath. The code works but i am having trouble getting any code for “get the children” to work. Have tried almost everything i could find on the net.
Any suggestion how to change this code so it works as i want? Thank you 🙂
<?php if (!empty($post->post_parent)) { $parentTitle = get_the_title($post->post_parent);?>
post_parent); ?>” title=”<?php echo $parentTitle; ?>”>Back to <?php echo $parentTitle; ?><?php } ?>
- The topic ‘Custom post type – parent and child link’ is closed to new replies.