I am trying to create a section on my page template that displays all the parent (top level) pages with its children listed below but only by the same author of the currently viewed page.
I have this code snippet below which perfect shows top level pages and their children below but need to tweak it so it only shows from same author.
I also need to ensure it displays the currently viewed page as well.
Is there anything simple I can add to what I have below?
<?php
$args = array(
'sort_column' => 'menu_order',
'parent' => 0,
);
$pages = get_pages($args);
foreach($pages as $page){
?>
<ul>
<li>
<?php
echo '<a href="' . get_permalink( $page->ID ) . '">' . $page- >post_title . '</a>';
?>
</li>
<?php
wp_list_pages('title_li=&depth=0&child_of='.$page->ID.'');
?>
</ul>
<?php
}
?>
I would then also like each of parent pages to have their own class and not include the actual link to the page, and then child pages to be sub items of the above class so I can create a drop down of all the users parent pages and children pages.
Thanks!