Viewing posts tagged with: IE

January 10th, 2008 Wordpress Should Update get_sidebar to Work With Multiple Sidebars

I submitted an enhancement to wordpress yesterday, to allow get_sidebar to work with multiple sidebars. It’s an extremely simple fix, and you end up with a function that looks like this:

function get_sidebar($name=null) {
	do_action( 'get_sidebar' );
	if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
		load_template( TEMPLATEPATH . "/sidebar-{$name}.php");
	elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
		load_template( TEMPLATEPATH . '/sidebar.php');
	else
		load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
}

By adding two lines and one optional parameter to the get_sidebar() function, you would be able to pass it a sidebar name. For example, get_sidebar(’left’) would load the template TEMPLATEPATH . ’sidebar-left.php’ allowing you to have multiple sidebar files as part of your template.
Read the rest of Wordpress Should Update get_sidebar to Work With Multiple Sidebars »

Search