List Subpages In Order By Creation Date
-
In essence of my previous topic in reference to this, I thought I got this up and running but unfortunately I didn’t.
I need for my subpages for
this page to be listed in order by the date it was created.Right now it looks like this:
* abortion. 03/08/09 (7 comments)
* domestic violence. 02/28/09 (5 comments)
* online infidelity. 03/17/09 (0 comments)But I need it to be like this:
* online infidelity. 03/17/09 (0 comments)
* abortion. 03/08/09 (7 comments)
* domestic violence. 02/28/09 (5 comments)Here is the php code I used:
<div class=”entrytext”>
<?php $children = get_pages(‘child_of=’.$post->ID.’&show_date=modified
&date_format=$date_format’);if ($children) : ?>-
<?php foreach ($children as $post) : setup_postdata($post); ?>
<li class=”page_item page-item-<?php echo $post->ID; ?>”>ID); ?>” title=”<?php echo get_the_title($post->ID); ?>”><?php echo get_the_title($post->DATE); ?> <small><?php the_time(‘m/d/y’) ?></small> <smallcomments>(<?php comments_number(‘0’, ‘1’, ‘%’ ); ?> comments)</smallcomments>
<?php endforeach; ?><?php endif; ?>
</div></div>
- The topic ‘List Subpages In Order By Creation Date’ is closed to new replies.