I am trying to create a dynamic loop on my wordpress site, where a parent page generates a column view of links to its sub pages.
I have been sucessfull in getting the links to populate with the correct name - $child->post_title - but I can only get the links to open the parent page. I have highlgted the code where i am having issues in red
Any assistance anyone can offer would be greatly appreciated.
<table class="variety_container"><tr>
<?php
$child_count=0;
echo "<td>";
foreach ($children as $child) {
//echo "child count is ". $child_count;
$new_col = $child_count > $children_per_col;
if ($new_col) {
echo "</td><td>";
$child_count=0;
}
$link = get_page_link( $page->ID + $child );
echo "<a href=$link>" . $child->post_title . "</a>";
echo "<br>";
$child_count++;
}?>
</tr></table><!--variety container-->