Skip to content

Instantly share code, notes, and snippets.

@omariosouto
Last active October 30, 2015 19:57
Show Gist options
  • Save omariosouto/19e3bddf806488ccade6 to your computer and use it in GitHub Desktop.
Save omariosouto/19e3bddf806488ccade6 to your computer and use it in GitHub Desktop.
Get Wordpress Child Pages
<?php
$args = array(
'post_type' => 'page',
'post_parent' => 96,
'post_status' => 'publish',
'orderby' => 'title',
'order' => 'ASC'
);
$cursos_query = new WP_Query( $args );
$contador = 0;
?>
<?php if($cursos_query->have_posts()) : while($cursos_query->have_posts()) : $cursos_query->the_post(); $contador++; ?>
<a href="<?php the_permalink(); ?>" class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php the_title(); ?></a>
<?php endwhile; endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment