'twabc', 'posts_per_page' => '-1', 'orderby' => $atts['orderby'], 'order' => $atts['order'] ); if($atts['category'] != ''){ $args['twabc_category'] = $atts['category']; } if(!isset($atts['image_size'])) $atts['image_size'] = 'full'; if(!isset($atts['use_javascript_animation'])) $atts['use_javascript_animation'] = '1'; if($atts['id'] != ''){ $args['p'] = $atts['id']; } // Collect the carousel content. Needs printing in two loops later (bullets and content) $loop = new WP_Query( $args ); $images = array(); $output = ''; while ( $loop->have_posts() ) { $loop->the_post(); if ( '' != get_the_post_thumbnail(get_the_ID(), $atts['image_size']) ) { $post_id = get_the_ID(); $title = get_the_title(); $content = get_the_excerpt(); $image_src = wp_get_attachment_image_src(get_post_thumbnail_id(), $atts['image_size']); $image_src_thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'featured_preview'); $image_src = $image_src[0]; $image_src_thumb = $image_src_thumb[0]; $images[] = array('post_id' => $post_id, 'title' => $title, 'content' => $content, 'img_src' => $image_src); } } // Check we actually have something to show if(count($images) > 0){ ob_start(); wp_enqueue_style( 'twabc', plugins_url('asset/css/twabc-advanced.css',__FILE__ ), array(), TWABC_VERSION ); ?>