'E0E0E0',
) );
// The custom header business starts here.
add_theme_support( 'custom-header' );
}
add_action( 'init', 'bito_setup' );
/**
* Registers our main widget area and the front page widget areas.
*
* @since Bito 2.0
*/
function bito_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'bito' ),
'id' => 'sidebar-1',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'bito_widgets_init' );
/**
* get containt layout.
*
* @since Bito 2.0
*/
function bito_col_class() {
$col_class = ' class="doublecol"';
if ( !is_dynamic_sidebar()
|| (is_page()
&& !is_page_template('archives.php')
&& !is_page_template('tags.php')) )
$col_class = ' class="singlecol"';
return $col_class;
}
/**
* This function is based on WP's built-in get_archives()
* It outputs the following:
*
*
* @since Bito 1.0
*/
function bito_archive()
{
global $month, $wpdb;
$arcresults = $wpdb->get_results('SELECT DISTINCT YEAR(post_date) AS year FROM '
.$wpdb->posts
." WHERE post_status='publish' AND post_type='post' AND post_password='' "
."ORDER BY post_date DESC ");
if ($arcresults) {
echo '', "\n";
echo '', "\n";
echo '| | ',"\n";
echo 'Jan | ',"\n";
echo 'Feb | ',"\n";
echo 'Mar | ',"\n";
echo 'Apr | ',"\n";
echo 'May | ',"\n";
echo 'Jun | ',"\n";
echo 'Jul | ',"\n";
echo 'Aug | ',"\n";
echo 'Sep | ',"\n";
echo 'Oct | ',"\n";
echo 'Nov | ',"\n";
echo 'Dec | ',"\n";
echo '
', "\n";
foreach ($arcresults as $arcresult) {
echo '', "\n";
$yearurl = get_year_link($arcresult->year);
$tdArray = array ("| " . get_archives_link($yearurl, $arcresult->year, '') . " | ") ;
for ($n=1;$n<13;$n++) {
$tdArray[]= ' | ';
}
$arcresults2 = $wpdb->get_results('SELECT DISTINCT MONTH(post_date) AS month, count(ID) as monthposts FROM '
.$wpdb->posts
." WHERE YEAR(post_date)='$arcresult->year' AND post_status='publish' AND post_type='post' AND post_password='' "
."GROUP BY MONTH(post_date) ORDER BY post_date DESC");
foreach ($arcresults2 as $arcresult2) {
$monthurl = get_month_link($arcresult->year, $arcresult2->month);
$tdArray[$arcresult2->month]=''. get_archives_link($monthurl, $arcresult2->monthposts, '') . ' | ';
}
for ($n=0;$n<13;$n++) {
echo $tdArray[$n],"\n";
}
echo '
', "\n";
}
echo '
', "\n";
}
}
?>