function custom_do_loop() { global $post; // arguments, adjust as needed $args = wp_parse_args( genesis_get_custom_field( 'query_args' ), array( 'post_type' => 'post', 'posts_per_page' => 8, // Change posts per page to 8 'post_status' => 'publish', 'cat' => '', 'paged' => get_query_var( 'paged' ) ) ); global $wp_query; $wp_query = new WP_Query( $args ); function get_first_post_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); $first_img = $matches [1] [0]; // Defines a default image if(empty($first_img)){ $first_img = "wp-includes/images/media/default.jpg"; } return $first_img; } function _sposts_thumbnails( $excerpt ) { global $post; $settings = get_option('sideposts_widget'); $images = get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $post->ID ); if ( $images ) { $img = array(); foreach( $images as $imageID => $imagePost ) { $img[] = wp_get_attachment_image_src($imageID); } $thumb = array_pop($img); $thumb_h = intval( (int) $settings['thumbnail'] * (int) $thumb[2] / (int) $thumb[1] ); } } // Select default or alternate layout for blog posts: Default = 1 / Alternate = 2 $blogLayout = 2; if ( have_posts() ) : echo '
'; echo ''; // Close the last row echo '
'; do_action( 'genesis_after_endwhile' ); endif; wp_reset_query(); } remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop add_action( 'genesis_loop', 'custom_do_loop' ); // Add custom loop genesis();