I have a landing page that pulls in an excerpt, title and thumbnail of its children. It works, except the title (which is the page title) link is doubling up the parent folder in the url it creates. like this: www.site.com/restaurant/restaurant/mcdonalds. I'm not great at PHP and I can't figure out why it's doubling on the title and not the thumbnail. How can i alter this to only pull in the parent once?
if ( is_page( 'restaurants' ) ) {
$pageChildren = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'menu_order', 'hierarchical' => '0', 'exclude' => '1453' ) );
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<div class="restaurant-landing"><h2><a href="' . get_page_uri($pageChild) .'">' . $pageChild->post_title . get_the_post_thumbnail($pageChild->ID).'</a></h2>';
if ($pageChild->post_excerpt){
echo '<p>'.$pageChild->post_excerpt.'</p></div>';
}
}
}
}