'widget_arras_articles', 'description' => __('Latest articles based on category', 'arras') ); $this->WP_Widget( 'arras_articles', __('Latest Articles', 'arras'), $widget_ops ); } function widget($args, $instance) { extract($args); $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : __('Latest Articles', 'arras'); $count = isset($instance['count']) ? (int) $instance['count'] : 10; $category = isset($instance['category']) ? (int) $instance['category'] : 1; echo $before_widget; echo $before_title . $title . $after_title; echo '
'; $r = new WP_Query('showposts=' . $count . '&cat=' . $category); if ( $r->have_posts() ) : $r->the_post(); echo '

' . get_the_title() . '

'; echo '' . get_the_title() . ''; echo '
'; if ( arras_get_option('post_preview') == 'content' ) the_content_rss('', true, '', 20, 2); else the_excerpt(); echo '
'; echo ''; endif; echo '
'; echo $after_widget; } function update($new_instance, $old_instance) { $instance = $old_instance; $new_instance = wp_parse_args( (array) $instance, array('title' => __('Latest Articles', 'arras'), 'count' => 10, 'category' => 1) ); $instance['title'] = strip_tags($new_instance['title']); $instance['category'] = (int) $new_instance['category']; $instance['count'] = (int) $new_instance['count']; return $instance; } function form($instance) { $cats = get_categories(); $instance = wp_parse_args( (array) $instance, array('title' => __('Latest Articles', 'arras'), 'count' => 10, 'category' => 1) ); ?>

'; echo ''; foreach ($sidebars_widgets['tabbed-sidebar'] as $id) { $widget = $wp_registered_widgets[$id]; //$params = array_merge( array('widget_id' => $id, 'widget_name' => $widget['name']), (array) $widget['params'] ); $params = array_merge( array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => '') ) ), (array) $wp_registered_widgets[$id]['params'] ); $params = apply_filters('dynamic_sidebar_params', $params); echo '
'; if ( is_callable($widget['callback']) ) { call_user_func_array($widget['callback'], $params); } echo '
'; } echo ''; } */ function arras_register_widgets() { unregister_widget('WP_Widget_Search'); register_widget('AR_Widget_Articles'); } add_action('widgets_init', 'arras_register_widgets'); /* End of file widgets.php */ /* Location: ./library/widgets.php */ ?>