Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save varickdesign/4557342 to your computer and use it in GitHub Desktop.
Save varickdesign/4557342 to your computer and use it in GitHub Desktop.
Working New Grid with Pagination in Genesis
function staff_do_grid_loop() {
$args = array(
'post_type' => 'page',
'meta_key' => 'staff',
'posts_per_page'=> 4,
'orderby' => 'menu_order',
'order' => 'ASC',
'paged' => get_query_var( 'paged' ),
);
global $wp_query;
$wp_query = new WP_Query( $args );
if( $wp_query->have_posts() ):
while( $wp_query->have_posts() ): $wp_query->the_post(); global $post;
$classes = 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ? 'post page type-page status-publish hentry genesis-grid genesis-grid-odd ' : 'post page type-page status-publish hentry genesis-grid genesis-grid-even ';
echo '<div class="' . $classes . '">';
echo '<h2 class="entry-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
echo '<div class="entry-content">';
echo '<a href="'.get_permalink().'">'; the_post_thumbnail('Bio-Thumbnails',array('class' => 'alignleft post-image'));echo '</a>';
echo '<p>' . get_the_excerpt() . '</p>';
echo '</div>';
echo '<div class="post-meta"></div>';
echo '</div>';
endwhile;
genesis_posts_nav();
endif;
wp_reset_query();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment