WordPress.org

Ready to get started?Download WordPress

Forums

How to display content sub pages from another parent page (4 posts)

  1. ScoobyDooobyD00
    Member
    Posted 5 years ago #

    Here's my site, http://scoobydooobyd00.com/

    I have two main pages (Videos and Video-Tutorial) I want the videos page to list the title and content from the sub pages to the parent Video-Tutorial.

    All of my videos are posted in their own sub page (Permalink = http://scoobydooobyd00.com/video-tutorial/getting-started-with-jquery/ and basically on the the Videos page I want to select the title, and content from the videos page in a loop.

    This is the code that I have right now, but it just select the content from the Video-Tutorial's page.

    <?php $my_query = new WP_Query('page_id=33/child'); ?>
    			<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    				<h2 class="header center"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    				<?php the_content(); ?>
    			<?php endwhile; ?>
  2. ScoobyDooobyD00
    Member
    Posted 5 years ago #

    I know I've only waited 4 hours but I really need an answer.

    Is what I'm trying to accomplish even possible?

  3. m2ew
    Member
    Posted 5 years ago #

    I don't know if this helps. This code will pull posts from a specific page.

    <?php query_posts('page_id=33'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content('Read the rest of this entry »'); ?>
    <?php endwhile; ?>

  4. m2ew
    Member
    Posted 5 years ago #

    For content, should just be:
    <?php the_content(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic