return list of children
-
Looking for some assistance in executing a query and returning the results of that query. What I’m looking for is to return the permalinks for pages which have page 306 as their parent. If I run this query in mysql it returns precisely what I’m looking for… but I just don’t know wordpress well enough to know how to do it in WP. I’ve tried, with no success, this:
<?php // The Query $the_query = new WP_Query( 'post_parent=306 AND post_type="page"' ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo '<li>'; echo '<a href="' . the_permalink() . '" title="' . the_title() . '">' . the_title() . '</a>'; echo '</li>'; endwhile; // Reset Post Data wp_reset_postdata(); ?>
What am I doing wrong? Thanks for your help!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘return list of children’ is closed to new replies.