WordPress.org

Ready to get started?Download WordPress

Forums

Only 1 child page showing of 9...why oh why? (2 posts)

  1. carlos-amigos
    Member
    Posted 5 years ago #

    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"...

  2. carlos-amigos
    Member
    Posted 5 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic