Loop de páginas subordinadas
por Vinicius Braga, segunda-feira, 7 de setembro de 2009 às 11:43
Loop do WordPress de listagens de páginas subordinadas a um página com ID 4.
<?php $my_query = new WP_Query('post_type=page&post_parent=4'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Link para <?php the_title_attribute('echo=1'); ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_content('Saiba mais...'); ?>
</div>
</div>
<?php edit_post_link( 'Edite','<p class="editThis">', '</p>'); ?>
<?php endwhile; ?>