__( 'Barra lateral derecha', 'twentyten' ), 'id' => 'sidebar-derecha-widget-area', 'description' => __( 'Zona para widgets en la barra lateral derecha del blog.', 'twentyten' ), 'before_widget' => '
', // Removes
  • 'after_widget' => '
  • ', // Removes 'before_title' => '

    ', // Replaces

    'after_title' => '

    ', // Replaces )); } /** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'archive_ajax_widgets_init' ); /* Function that registers our widget. */ function archive_ajax_load_widgets() { register_widget( 'WP_Widget_Archivo_Chic' ); do_action('widgets_init'); } /* Add our function to the widgets_init hook. */ add_action( 'init', 'archive_ajax_load_widgets', 1 ); class WP_Widget_Archivo_Chic extends WP_Widget { function WP_Widget_Archivo_Chic() { $widget_ops = array('classname' => 'widget_archive_chic', 'description' => __( "AJAX Archive by year.") ); $this->WP_Widget('archive_chic', __('AJAX Archive'), $widget_ops); } function widget( $args, $instance ) { global $wpdb; extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; // Use current theme search form if it exists ?> get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND YEAR(post_date) <= YEAR (CURRENT_DATE) ORDER BY post_date DESC"); ?> '') ); $title = $instance['title']; ?>

    '')); $instance['title'] = strip_tags($new_instance['title']); return $instance; } } add_action('wp_head', 'archive_ajax_css'); function archive_ajax_css() { ?>