Skip to content

Instantly share code, notes, and snippets.

@ximosa ximosa/pagina-hija
Last active Feb 15, 2017

Embed
What would you like to do?
Crear listado de páginas hijas en genesis
<?php
// Template Name: Pages-hijas
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_loop');
function custom_loop() {
global $post;
$pageid = $post->ID;
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$my = new WP_Query( $args );
while ( $my->have_posts() ): $my->the_post();
global $more;
$more = 0; ?>
<div class="subpage-post">
<div class="featured-image">
<?php echo the_post_thumbnail( ‘thumbnail’ ); ?>
</div>
<h3 class="entry-title">
<a href="<?php echo the_permalink(); ?>"> <?php echo the_title(); ?></a></h3>
<div class="entry-content">
<?php echo the_excerpt(); ?>
</div>
</div>
<?php endwhile;
wp_reset_query();
} ?>
<?php genesis() ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.