Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Override the Genesis loop (works when using the Grid Loop)
/**
* Use custom content for the loop
*/
function rb_custom_loop() {
while(have_posts()) : the_post();
?>
<article <?php post_class(); ?>>
<?php
$img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) );
printf( '%s', $img );
?>
<h2 class="entry-title"><?php the_title(); ?></h2>
</article>
<?php
endwhile;
}
remove_action('genesis_loop','genesis_do_loop');
add_action('genesis_loop','rb_custom_loop');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment