SubPage List
-
I want to show the subpage list of a specific Page In 2 column i am using following code but it showes only 5 subpages in 2 column other subpages get excluded My Parent Page id is 22.
<?php
$args = array(
‘post_type’ => ‘page’,
‘post_parent’=> 22,
‘depth’=> 1
);$pages = get_posts($args);
update_post_caches($pages);
$out = “”;
foreach($pages as $page)
{if($out == “”)
{
$out = ‘ID).'” ><span>’.wptexturize($page->post_title).'</span>‘;
}
else
{
$out .= ‘,ID).'” ><span>’.wptexturize($page->post_title).'</span>‘;
}
}
$cats = explode(“,”,$out);
$cat_n = count($cats);
//echo count($cats);
for ($i=0;$i<$cat_n;$i++):
//echo $i;
if ($i<$cat_n/2):
$cat_left = $cat_left.’- ‘.$cats[$i].’
- ‘.$cats[$i].’
‘;
elseif ($i>=$cat_n/2):
$cat_right = $cat_right.’‘;
endif;
endfor;
?><?php //endwhile; ?>
<ul class=”fltlft”>
<?php echo $cat_left;?><ul class=”fltrt”>
<?php echo $cat_right;?>Thanks in advance
- The topic ‘SubPage List’ is closed to new replies.