ID ), 'full-size' ) ) { $background_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full-size' ); $background_image = $background_image[0]; } if ( get_header_image() ) { $background_image = get_header_image(); } // Setup paging for portfolio pagaination if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; } // Set a variable to tell us if there are pagination links to we can take care of spacing issues $pagination = false; ?> 'page', 'meta_key' => '_wp_page_template', 'meta_value' => 'template-portfolio-item.php', 'post_status' => 'publish', 'posts_per_page' => $portfolio_items, 'orderby' => 'menu_order', 'order' => 'ASC', 'paged' => $paged ); $wp_query = new WP_Query( $args ); // Set the pagination variable to true if we have more than one page if ( $wp_query->max_num_pages > 1 ) $pagination = true; // Work out how big the image should be based on how many cols we want $img_size = 'themeora-portfolio-span-8'; if ( $wp_query->have_posts() ) : ?>