Linking Parent link to page.
-
I am using the below code in my nav. It works perfectly at showing me the top level parent of the page no matter what subpage I am on. The only issue I am having is making it a link back to that page. Can someone tell me what to do to make it link back… I am a php newbie but I am a master cut and paster. Thanks
<div id="sideNavParent"> <?php if($post->post_parent) { $ancestors = get_post_ancestors($post->ID); $root = count($ancestors)-1; $parent = $ancestors[$root]; $parent_title = get_the_title($parent); echo $parent_title; } else { wp_title(''); } ?> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Linking Parent link to page.’ is closed to new replies.