Month Year * */ function BX_archive() { global $month, $wpdb; $now = current_time('mysql'); $arcresults = $wpdb->get_results('SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM ' . $wpdb->posts . ' WHERE post_date <\'' . $now . "' AND post_status='publish' AND post_type='post' AND post_password='' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC"); if ($arcresults) { foreach ($arcresults as $arcresult) { $url = get_month_link($arcresult->year, $arcresult->month); $text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year); echo get_archives_link($url, $text, '','

','

'); $thismonth = zeroise($arcresult->month,2); $thisyear = $arcresult->year; $arcresults2 = $wpdb->get_results('SELECT ID, post_date, post_title, comment_status FROM ' . $wpdb->posts . " WHERE post_date LIKE '$thisyear-$thismonth-%' AND post_status='publish' AND post_type='post' AND post_password='' ORDER BY post_date DESC"); if ($arcresults2) { echo '', "\n"; } } } } /** * Function BX_excluded_pages() * ------------------------------------------------ * Returns the Bito default pages that are excluded * from the navigation in the sidebar */ function BX_excluded_pages() { $page_paths = array('archives', 'about', 'about_short', 'contact'); foreach ($page_paths as $page_path) { $page = get_page_by_path($page_path); if ($page) $exclude .= $page->ID . ','; } return rtrim($exclude, ','); } /** * Function BX_remove_p * --------------------------------------------------- * Removes the opening

and closing

from $text * Used for the short about text on the front page */ function BX_remove_p($text) { $text = apply_filters('the_content', $text); $text = preg_replace("/^[\t|\n]?

(.*)/","\\1",$text); // opening

$text = preg_replace("/(.*)<\/p>[\t|\n]$/","\\1",$text); // closing

return $text; } ?>