pjm06200 Posted February 13, 2013 Share Posted February 13, 2013 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--> Link to comment https://forums.phpfreaks.com/topic/274448-help-looping-child-link-population/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.