Template tag to pull current page and create link to it for subnav?
-
Hi,
I am trying to create a subnavigation in the sidebar of my site.
I have used this code below to pull the children of the parent page of the section.
I want to also be able to pull the title of the parent page of the section and link it to its page and add to subnav.
How would i do that? I know it has to be somewhat easy to do, just not sure the syntax.
thanks for any help!
a<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <a href=""><?php the_title(); ?></a> <ul id="subnav"> <?php echo $children; ?> </ul> <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Template tag to pull current page and create link to it for subnav?’ is closed to new replies.