Forums

child pages query ? (3 posts)

  1. nyckidd
    Member
    Posted 9 months ago #

    hey guys am using the below query to pull my child pages

    <?php
    query_posts('post_type=page&post_parent='.$parent);
    ?>
    	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 
    
    my content here
    
    <?php endwhile; ?>
    
    				<?php wp_reset_query(); ?>

    now the problem is when i click on a link of one of the child pages its not showing me the scorrect content rather the latest child page content under the parent page...how do i tweak the code ?

    Thanks

  2. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    Try using get_posts or WP_Query if this is a secondary Loop (which I assume it is).

  3. nyckidd
    Member
    Posted 9 months ago #

    Thanks esmi....i used the query_posts and it worked like a charm

Reply

You must log in to post.

About this Topic