List Child Pages Offset Help
-
Hello, I’m having trouble trying to list child pages of the current page. I have read the Codex page about 30 times and tried every variation I saw. I can successfully list the child pages of a current page but I cannot get the offset to work properly. I on;y want to show lower level pages. Please see my example as this sounds confusing even to me. I’ve tried each of the examples below with limited success. All 3 are currently on my page template so you can see how they are all functioning. Can someone help me modify the list pages code to work properly? I am only partially understanding how this works. Thanks.
Current code in page template
<?php if($post->post_parent) $children = wp_list_pages('title_li=&offset=2&child_of='.$post->post_parent."&echo=0"); else $children = wp_list_pages('title_li=&child_of='.$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
<ul> <?php wp_list_pages('offset=2&title_li='); ?> </ul>
<?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘List Child Pages Offset Help’ is closed to new replies.