defaults = array( 'title' => '', 'post_type' => '', 'image_size' => '', 'post_num' => 5, 'show_caption' => 0 ); $widget_ops = array( 'classname' => 'flexslider_widget', 'description' => __( 'Featured Slider', 'acfs' ), ); $control_ops = array( 'id_base' => 'arconix-flexslider-widget' ); $this->WP_Widget( 'arconix-flexslider-widget', 'Arconix - FlexSlider', $widget_ops, $control_ops ); if ( is_active_widget( false, false, $this->id_base ) ) add_action( 'wp_head', array( $this, 'load_js' ), 99 ); } function load_js() { /*?> defaults ); /** Before widget (defined by themes) */ echo $before_widget; /** Title of widget (before and after defined by themes) */ if( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; $query_args = array( 'post_type' => $instance['post_type'], 'posts_per_page' => $instance['post_num'], ); $flex_posts = new WP_Query( $query_args ); if ( $flex_posts->have_posts() ) { echo '
/>