__('Core Navigation','bsimple') )); // Register sidebars a_theme::register_sidebars(); // Add support for custom backgrounds add_custom_background(); // Add HTML5 support to IE wp_enqueue_script('html5.js',get_bloginfo('template_url').'/js/html5.js'); class a_theme { private static $_theme='bsimple'; /** Compiles an array of HTML attributes into an attribute string. **/ public static function attributes($_attrs) { if(!empty($_attrs)) { $_attributes=''; foreach($_attrs as $_key=>$_val) { $_attributes .= ' '.$_key.'="'.$_val.'"'; } return $_attributes; } } /** Register sidebars **/ public static function register_sidebars($_num=1,$_heading='h3') { register_sidebars($_num, array( 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '<'.$_heading.'>', 'after_title' => '', ) ); } /** Load theme sidebar **/ public static function sidebar() { if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) { }; } /** Title element **/ public static function get_title($_separator='-') { $_separator = apply_filters('amphibian_title_separator', $_separator); if (is_front_page()) $_title = get_bloginfo('name').' '.$_separator.' '.get_bloginfo('description'); else $_title = wp_title($_separator, false, 'right').get_bloginfo('name'); return apply_filters('amphibian_title', $_title); } public static function title() { echo self::get_title(); } /** Build site name with link, tag used is based on page being displayed **/ public static function get_site_name($_id=NULL,$_class=NULL,$_tag1='h1',$_tag2='p') { if(!empty($_id)) $_attrs['id']=$_id; if(!empty($_class)) $_attrs['class']=$_class; $_attrs=isset($_attrs)?self::attributes($_attrs):''; $_tag=(is_front_page() || is_home())?$_tag1:$_tag2; $_sitename = '<'.$_tag.$_attrs.'>'. get_bloginfo('name').''."\n"; return apply_filters('amphibian_site_name', $_sitename); } public static function site_name($_id=NULL,$_class=NULL,$_tag1='h1',$_tag2='p') { echo self::get_site_name($_id,$_class,$_tag1,$_tag2); } /** Build site desc (tagline) with link, tag used is based on page being displayed **/ public static function get_site_desc($_id=NULL,$_class=NULL,$_tag='p') { if(!empty($_id)) $_attrs['id']=$_id; if(!empty($_class)) $_attrs['class']=$_class; $_attrs=isset($_attrs)?self::attributes($_attrs):''; $_sitedesc = '<'.$_tag.$_attrs.'>'.get_bloginfo('description'). ''."\n"; return apply_filters('amphibian_site_desc',$_sitedesc); } public static function site_desc($_id=NULL,$_class=NULL,$_tag='p') { echo self::get_site_desc($_id,$_class,$_tag); } /** Post title **/ public static function get_post_title($_tag1='h1',$_tag2='h2') { if (is_single() || is_page()) { $_post_title = '<'.$_tag1.'>'.get_the_title().''."\n"; } else { $_post_title = '<'.$_tag2.'>'. get_the_title().''."\n"; } return apply_filters('amphibian_post_title', $_post_title); } public static function post_title($_tag1='h1',$_tag2='h2') { echo self::get_post_title(); } /** Display comments **/ public static function display_comments($_option=TRUE) { if(is_single()) return apply_filters('amphibian_display_post_comments',$_option); if(is_page()) return apply_filters('amphibian_display_page_comments',$_option=FALSE); } /** Display post navigation **/ public static function display_post_nav() { global $wp_query; return ($wp_query->max_num_pages > 1); } /** Avatar size **/ public static function avatar_size($_size=48) { return apply_filters('amphibian_avatar_size',$_size); } }