Post parent page as a title for all the child pages on sidebar .
-
Ok, I think thi might be very easy but I am new to php, so here goes.
I have set up a sidebar to show only a list of related child pages and parent. I have links to the parents at the top of the page as tabs and the side bar changes according to the tab I select. Here is how I did the sidebar:
<?php
if($post->post_parent)
$children = wp_list_pages(“sort_column=menu_order&title_li=&child_of=”.$post->post_parent.”&echo=0″); else
$children = wp_list_pages(“sort_column=menu_order&title_li=&child_of=”.$post->ID.”&echo=0″);
if ($children) { ?>-
<?php echo $children; ?>
<?php } ?>
This worked like a charm, but I also want to add the parent title to appear as the title of the list on the sidebar. I think I could change the “title_li=” and add some kind of parameter after the “=” where this will call for the name of the parent page, but I don’t know what that parameter is. Does anyone have any ideas?????
Thank you very much
- The topic ‘Post parent page as a title for all the child pages on sidebar .’ is closed to new replies.