• Resolved steve-from-breathe4u

    (@steve-from-breathe4u)


    Hi Everyone,

    I wonder if anyone can help me I’m trying to limited the number of pages that the following code shows, any help any could give I’d very much appreciate

    thanks

    <?php
    	$mypages = get_pages( array( 'child_of' => 2, 'sort_column' => 'post_date', 'sort_order' => 'rand' ) );
    
    	foreach( $mypages as $page ) {
    		$content = $page->post_excerpt;
    		if ( ! $content ) // Check for empty page
    			continue;
    
    		$content = apply_filters( 'the_excerpt', $content );
    	?>
    		<h2><a>"><?php echo $page->post_title; ?></a></h2>
    		<div class="entry"><?php echo $content; ?></div>
    	<?php
    	}
    ?>
  • The topic ‘limit number of pages displayed’ is closed to new replies.