Page ordering not working on live page
-
Hi,
I found a custom child pages code from this forum that allows to display the featured image and first couple of sentences of child pages on the parent page. It’s working beautifully, but I can’t seem to get the page ordering to work. Does anyone notice the flaw here?
<?php /* Template Name: Child pages */ get_header();?> <div id="main"> <div id="maintext"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?></h1> </header> <div class="entry-content" style="clear:both;"> <?php the_content(); ?> <?php $args = array( 'post_parent' => $post->ID, 'post_type' => 'page', 'post_status' => 'publish', 'numberposts' => -1 ); $postslist = get_posts($args); ?> <?php foreach ( $postslist as $post ) : ?> <?php setup_postdata( $post ); ?> <div class="project"> <a href="<?php the_permalink(); ?>" style="float:left; padding: 0px 15px 0px 0px;"><?php if( has_post_thumbnail() ) the_post_thumbnail('Project'); ?></a> <div class="project-meta"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </div><!-- project-meta --> <div class="project-summary"> <?php the_excerpt(); ?> </div><!-- project-summary --> </div><!-- project --> <?php endforeach; ?> </div><!-- entry-content --> <?php endwhile; endif; ?> </div><!-- end of maintext --> </div><!-- end of main --> <?php get_sidebar();?> <?php get_footer();?>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Page ordering not working on live page’ is closed to new replies.