'athemes_services_widget', 'description' => __( 'Show what services you are able to provide.', 'talon') ); parent::__construct(false, $name = __('Talon: Services', 'talon'), $widget_ops); $this->alt_option_name = 'athemes_services_widget'; } function form($instance) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $number = isset( $instance['number'] ) ? intval( $instance['number'] ) : -1; $category = isset( $instance['category'] ) ? esc_attr( $instance['category'] ) : ''; $links_title = isset( $instance['links_title'] ) ? esc_html( $instance['links_title'] ) : __('Learn more', 'talon'); $see_all = isset( $instance['see_all'] ) ? esc_url( $instance['see_all'] ) : ''; $see_all_text = isset( $instance['see_all_text'] ) ? esc_html( $instance['see_all_text'] ) : ''; $two_cols = isset( $instance['two_cols'] ) ? (bool) $instance['two_cols'] : false; ?>

id="get_field_id( 'two_cols' ); ?>" name="get_field_name( 'two_cols' ); ?>" />

id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $see_all = isset( $instance['see_all'] ) ? esc_url($instance['see_all']) : ''; $see_all_text = isset( $instance['see_all_text'] ) ? esc_html($instance['see_all_text']) : ''; $number = ( ! empty( $instance['number'] ) ) ? intval( $instance['number'] ) : -1; if ( ! $number ) $number = -1; $category = isset( $instance['category'] ) ? esc_attr($instance['category']) : ''; $two_cols = isset( $instance['two_cols'] ) ? $instance['two_cols'] : false; if (!$two_cols) { $cols = 'three-cols'; } else { $cols = 'two-cols'; } $links_title = isset( $instance['links_title'] ) ? esc_html($instance['links_title']) : __('Learn more', 'talon'); $services = new WP_Query( array( 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => 'services', 'posts_per_page' => $number, 'category_name' => $category ) ); echo $args['before_widget']; if ($services->have_posts()) : ?>
have_posts() ) : $services->the_post(); ?>
'; the_post_thumbnail('talon-home-small'); echo ''; ?>
'; ?> '; ?>

' . sprintf( _x('Info: you have not created any services. Make sure you have installed the %1$s plugin and then create some services %2$s', 'no posts info', 'talon'), 'aThemes Toolbox', '' . __('here', 'talon') . '' ) . ''; endif; echo $args['after_widget']; } }