text_fields = array('magnitude-categorised-posts-title', 'magnitude-posts-number', 'magnitude-excerpt-length'); $this->select_fields = array('magnitude-select-category', 'magnitude-show-excerpt'); $widget_ops = array( 'classname' => 'magnitude_single_col_categorised_posts', 'description' => __('Displays posts from selected category in single column.', 'magnitude'), 'customize_selective_refresh' => false, ); parent::__construct('magnitude_single_col_categorised_posts', __('AFTM Single Column ', 'magnitude'), $widget_ops); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { $instance = parent::magnitude_sanitize_data($instance, $instance); /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters('widget_title', $instance['magnitude-categorised-posts-title'], $instance, $this->id_base); $category = isset($instance['magnitude-select-category']) ? $instance['magnitude-select-category'] : '0'; $show_excerpt = isset($instance['magnitude-show-excerpt']) ? $instance['magnitude-show-excerpt'] : 'true'; // open the widget container echo $args['before_widget']; ?>

have_posts()) : while ($all_posts->have_posts()) : $all_posts->the_post(); global $post; $thumbnail_size = 'magnitude-medium'; ?>
ID); ?> ID); ?> ID); ?>

ID)); ?>
form_instance = $instance; $options = array( 'true' => __('Yes', 'magnitude'), 'false' => __('No', 'magnitude'), ); $categories = magnitude_get_terms(); if (isset($categories) && !empty($categories)) { // generate the text input for the title of the widget. Note that the first parameter matches text_fields array entry echo parent::magnitude_generate_text_input('magnitude-categorised-posts-title', 'Title', 'Single Column Posts'); echo parent::magnitude_generate_select_options('magnitude-select-category', __('Select category', 'magnitude'), $categories); echo parent::magnitude_generate_select_options('magnitude-show-excerpt', __('Show excerpt', 'magnitude'), $options); } //print_pre($terms); } } endif;