<?php
//Legacy Comments
add_filter('comments_template','legacy_comments');
function legacy_comments($file) {
	if(!function_exists('wp_list_comments')) {
		$file = TEMPLATEPATH.'/legacy/comments.php';
	}
	return $file;
}
//post_class function
function post_class( $class = '', $post_id = null ) {
	// Separates classes with a single space, collates classes for post DIV
	echo 'class="' . join( ' ', get_post_class( $class, $post_id ) ) . '"';
}
//get_post_class function
function get_post_class( $class = '', $post_id = null ) {
	$post = get_post($post_id);
	$classes = array();
	$classes[] = $post->post_type;
	// sticky for Sticky Posts
	if ( is_sticky($post->ID) && is_home())
		$classes[] = 'sticky';
	// hentry for hAtom compliace
	$classes[] = 'hentry';
	// Categories
	foreach ( (array) get_the_category($post->ID) as $cat ) {
		if ( empty($cat->slug ) )
			continue;
		$classes[] = 'category-' . $cat->slug;
	}
	// Tags
	foreach ( (array) get_the_tags($post->ID) as $tag ) {
		if ( empty($tag->slug ) )
			continue;
		$classes[] = 'tag-' . $tag->slug;
	}
	if ( !empty($class) ) {
		if ( !is_array( $class ) )
			$class = preg_split('#\s+#', $class);
		$classes = array_merge($classes, $class);
	}
	return apply_filters('post_class', $classes, $class, $post_id);
}
//a function to get basic functionality for a wp_page_menu function
function wp_page_menu() {
	global $wp_theme_options;
	$include = $wp_theme_options['include_pages'];
	$include_pages = implode(',',(array)$include );
	$menu = '<div class="menu"><ul>';
	if(in_array('home',(array)$include)) {
		if(is_home()) $homeclass = ' class="current_page_item"';
		$menu .= '<li'.$homeclass.'><a href="'.get_settings('home').'">'.__('Home').'</a></li>';
	}
	$menu .= wp_list_pages(array('include' => $include_pages, 'title_li' => '', 'depth' => '2', 'sort_column' => 'menu_order, post_title', 'echo' => 0));
	$menu .= '</ul></div>';
	$menu = apply_filters('wp_page_menu',$menu);
	echo $menu;
}
function is_sticky() {
	return FALSE;
}
?>