Skip to content

Instantly share code, notes, and snippets.

@bradpotter
Created February 1, 2015 04:45
Show Gist options
  • Save bradpotter/f16ed1aab179c3de5241 to your computer and use it in GitHub Desktop.
Save bradpotter/f16ed1aab179c3de5241 to your computer and use it in GitHub Desktop.
function my_custom_loop() {
$args = array(
'category_name' => 'featured',
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page'=> '3',
);
$loop = new WP_Query( $args );
if( $loop->have_posts() ) {
echo '<div class="front-page-slider"><div class="wrap">';
// Loop through the posts
while( $loop->have_posts() ): $loop->the_post();
do_action( 'genesis_before_entry' );
printf( '<article %s>', genesis_attr( 'entry' ) );
do_action( 'genesis_before_entry_content' );
$img = genesis_get_image( array(
'format' => 'html',
'size' => genesis_get_option( 'image_size' ),
'context' => 'archive',
'attr' => genesis_parse_attr( 'entry-image' ),
) );
printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img );
do_action( 'genesis_after_entry_content' );
do_action( 'genesis_entry_header' );
the_excerpt();
// do_action( 'genesis_entry_footer' );
echo '</article>';
do_action( 'genesis_after_entry' );
endwhile;
echo '</div></div>';
}
wp_reset_postdata();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment