1. Doug Stewart
  2. literalbarrage

Source

literalbarrage / functions.php

<?php
define( 'SOCIAL_COMMENTS_CSS', false );
register_sidebar(array('name'=>'BigBar',
					   'before_widget' => '<li>', 
					   'after_widget' => '</li>', 
					   'before_title' => '<h4>', 
					   'after_title' => '</h4>' ) );

function lbc_title(){
		if (is_page()) { $temp_head_title = trim(strtolower(wp_title('', false))); }
		if (is_single()) { $temp_head_title = "blog"; }
		if (is_archive()) { $temp_head_title = "archives"; }
		if (is_404()) { $temp_head_title = "404'd!"; }
		if (is_search()) { $temp_head_title = "search"; }
		if (function_exists('is_bbpress') && is_bbpress()) { $temp_head_title = "forums"; }
		if (is_home()) { 
			$temp_head_title = "";
			$title_wrapper_s = '<h1>';
			$title_wrapper_e = '</h1>';
		} else {
			$title_wrapper_s = '<p class="blogtitle">';
			$title_wrapper_e = '</p>';
			$temp_head_title = ":".$temp_head_title;
		}
	?>
	<?php echo $title_wrapper_s; ?><span id="blogtitle"><a href="<?php bloginfo('url'); ?>"><?php echo get_bloginfo('name'); ?></a></span><span id="blogselector"><?php echo $temp_head_title; ?></span><?php echo $title_wrapper_e; ?>
<?php 
}
add_action( 'lblg_print_title', 'lbc_title' );

function lbc_the_title(){
	?>
	<div id="title-full"><h1><?php the_title(); ?></h1></div>
	<?php
}

function lbc_unplug_title(){
	remove_action('lblg_print_title', 'lblg_title');
}
add_action( 'init', 'lbc_unplug_title' );

function lbc_unplug_the_title(){
	if( is_single() ){
		remove_action( 'lblg_the_title', 'lblg_print_the_title' );
		add_action( 'lblg_above_content_and_sidebars', 'lbc_the_title' );
	}
}
add_action( 'wp_head', 'lbc_unplug_the_title' );

function lbc_unplug_bp_menu(){
	remove_action( 'widgets_init', 'lblg_add_default_buddypress_menu' );
	remove_action( 'lblg_print_bp_menu', 'lblg_bp_menu' );
}
add_action( 'init', 'lbc_unplug_bp_menu' );

function lbc_sidebar_header(){
	echo "<div id=\"bigbar\">\n";
	echo "<ul>\n";
 	if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('BigBar') ) : 

    endif; 
    echo "</ul>\n";
}
add_action( 'lblg_sidebar_header', 'lbc_sidebar_header' );

function lbc_sidebar_footer(){
	echo "</div>";
}
add_action( 'lblg_sidebar_footer', 'lbc_sidebar_footer' );

function lbc_enqueue_styles() {
	global $lblg_options, $lblg_shortname;
	
	$layout_handle = $lblg_shortname . '_layout_stylesheet';
	$alt_style_handle = $lblg_shortname . '_alt_stylesheet';
	
	remove_action( 'lblg_enqueue_styles', 'lblg_styles' );
	$layout_style_option = $lblg_options['layout_stylesheet'];
	$alt_style_option = $lblg_options['child_alt_stylesheet'];
	
	switch($layout_style_option){
		case '':
		case 'Select a layout:':
			$layout = get_template_directory_uri() . '/layouts/2-columns-fixed-sb-right.css';
		break;
		case '*none*':
			unset($layout);
		break;
		default:
			$layout = get_template_directory_uri() . '/layouts/' . $layout_style_option;
		break;
	}
	
	switch($alt_style_option){
		case '':
		case 'Select a stylesheet:':
			$alt_style = get_stylesheet_directory_uri() .'/styles/ojg.css';
		break;
		case '*none*':
			unset($alt_style);
		break;
		default:
			$alt_style = get_stylesheet_directory_uri() .'/styles/'. $alt_style_option;
		break;
	}
	
	if( isset($layout) ){
		wp_enqueue_style( $layout_handle , $layout, '', '', 'screen' );
	}
	
	if( isset($alt_style) ){
		wp_enqueue_style( $alt_style_handle, $alt_style, '', '1.1-beta3', 'screen' );
	}
}
add_action( 'lblg_enqueue_styles', 'lbc_enqueue_styles' );