WordPress.org

Support

Support » How-To and Troubleshooting » Only 1 child page showing of 9…why oh why?

Only 1 child page showing of 9…why oh why?

  • On my page http://www.mosaicexecutive.com/industry-executive-interviews I have the following code (on a template called Subpage)

    (I got the code from another thread in WordPress).

    <?php
    	$pageChildren = $wpdb->get_results("
    		SELECT *
    		FROM $wpdb->posts
    		WHERE post_parent = ".$post->ID."
    		AND post_type = 'page'
    		ORDER BY menu_order
    	", 'OBJECT');
    
    	if ( $pageChildren ) :
    		foreach ( $pageChildren as $pageChild ) :
    			setup_postdata( $pageChild );
    			?>
    		<div class="entry">
    			<img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" class="left"><?php $values = get_post_custom_values("excerpt"); echo $values[0]; ?>
                <p align="right"><?php print '<a href="' . get_permalink( $pageChild->ID ) . '">[more]</a>'; ?></p>
    		</div>
            <br clear="all">
            <hr class="snip" />
    
    		<?php
    		endforeach;
    	endif;
    	?>

    Which grabs all child pages and outputs some info & custom fields on a page.

    And once someone clicks on the child page link for some only the first page (the Mike Clayville one) works and all the rest don’t. All child pages use the same template “Page.php”…

Viewing 1 replies (of 1 total)
  • I have now upgraded to 2.6.1 to see if that would fix the problem, but still getting the same issue.

    I also tried unpublishing the first sub page, to see if that would fix things but it still hasn’t.

    Any help would be appreciated.

    🙂

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Only 1 child page showing of 9…why oh why?’ is closed to new replies.
Skip to toolbar