get_pages "numbers" and sort_order "desc" doesn't work
-
Is there something wrong with this code? Because i can’t get to display the latest grandchild of ‘2’.
Also, sort_order = desc doesn’t display anything.Thanks very muhc
<?php echo 'get pages'; $parent = '2'; $args=array( 'child_of' => $parent, 'post_type' => 'page', 'sort_column'=> 'post_date', 'sort_order' => 'desc', 'number' => 7 ); $pages = get_pages($args); if ($pages) { foreach($pages as $post) { setup_postdata($post); if ($post->post_parent != $parent ) { ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php } } // foreach($pages } // if ($pages ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_pages "numbers" and sort_order "desc" doesn't work’ is closed to new replies.