0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Multiple Widgetizable Sidebars

Instead of using multiple “if” statements to include multiple widgetizable areas, WPEngineer shows us how to do it a better way:

<?php // multiple widgetizable sidebars
if (function_exists('register_sidebar')) {
	$sidebars = array('Home Sidebar', 'Post Sidebar', 'Page Sidebar');
	foreach($sidebars as $name) {
		register_sidebar(array('name'=> $name,
			'before_widget' => '<div id="%1$s" class="widget %2$s">',
			'after_widget' => '</div>',
			'before_title' => '<h3 class="widgetTitle">',
			'after_title' => '</h3>',
		));
	}
}
?>

Source: wpengineer




0