get nested pages
-
Hey all,
I have been trying to find a way to return page information in order to create a landing page. I have done this with posts before to create a blog reel and would like to achieve the same overall result with pages with respect to parent elementsThe Scenario:
I use a drop menu with pages created in the wordpress. Nesting the pages builds the menu.The Goal:
I would like to get the subpages specific to the parent page. When a user navigates to the parent page I would like it to return links to the subpages with some page elements.Here is an example of how I have done this with posts:
‘ <?php
global $post;
$myposts = get_posts(‘numberposts=4&offset=news&category_name=news’);
foreach($myposts as $post) :
setup_postdata($post);
?>
<div class=”sidebarpost_newsitem”>
<div class=”sidebarpost_title”><h5><?php the_title();?></h5></div>
<div class=”sidebarpost_excerpt”><?php the_excerpt(); ?></div>
<div class=”sidebarpost_break”></div>
</div>
<?php endforeach; ?>’
- The topic ‘get nested pages’ is closed to new replies.