make_shortcode(); } function build_shortcode($atts) { $atts = shortcode_atts( array( 'title' => 'Astronomy Daily', 'count' => '1', 'size' => 'post-thumbnail', ), $atts ); $all_sizes = get_intermediate_image_sizes(); for ( $i=0; $i < count($all_sizes); $i++ ) { if ( $atts['size'] == $all_sizes[$i]) { $size = $all_sizes[$i]; break; } } if ( is_null($size) ) $size = 'post-thumbnail'; $args = array( 'posts_per_page' => $atts['count'], 'post_type' => 'astro', 'orderby' => 'date' ); $astro = get_posts( $args ); ?>