Last active
February 15, 2017 23:23
-
-
Save ximosa/580f28bf742f7cec52e7bd7d5f9768b4 to your computer and use it in GitHub Desktop.
Crear listado de páginas hijas en genesis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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