WordPress.org

Ready to get started?Download WordPress

Forums

WP_Query to pull more than one Page Parent (1 post)

  1. charlietriplett
    Member
    Posted 5 years ago #

    I'm trying to use WP_Query to pull a list of a specific page's sub-pages and a great deal of custom values. For example:

    <?php $page_query = new WP_Query('post_type=page&post_parent=782&orderby=title&order=asc'); ?>
    
    <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
    <div class="faculty">
    <div class="faculty_name">
    <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <?php // Lists values with the key Title
    $mykey_values = get_post_custom_values('Title');
    if (isset ($mykey_values)) {
    foreach ( $mykey_values as $key => $value ) {
    echo " | <span class=\"title\">$value</span>";
    }
    } ?>
    </h3>
    </div>
    <?php endwhile; ?>

    What I need to do NEXT is pull that same query from more than one parent page and display them in in one page.

    I've been hitting my head against the wall on this all night. Any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic