Return to Snippet

Revision: 15370
at July 2, 2009 22:17 by fouroclockproject


Updated Code
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Header Sidebar 3',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Header Sidebar 4',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

function widget_header() { ?>

<div class="sidebar_3">
	<ul class="sidebar_list">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header Sidebar 3') ) { ?>
		<li class="widget">
			<div class="widget_box">
				<h3><?php _e('Header Sidebar 3', 'thesis'); ?></h3>
				<p>This is your new sidebar.  You can add widgets to it like normal using the Widgets Panel.</p>
			</div>
		</li>
<?php	}	?>
	</ul>
</div>


<div class="sidebar_4">
	<ul class="sidebar_list">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header Sidebar 4') ) { ?>
		<li class="widget">
			<div class="widget_box">
				<h3><?php _e('Header Sidebar 4', 'thesis'); ?></h3>
				<p>This is your new sidebar.  You can add widgets to it like normal using the Widgets Panel.</p>
			</div>
		</li>
<?php	}	?>
	</ul>
</div>

<?php
}
add_action('thesis_hook_header', 'widget_header');

Revision: 15369
at July 2, 2009 14:12 by fouroclockproject


Initial Code
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Header Sidebar 3',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));

if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Header Sidebar 4',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));

function widget_header() { ?>

<div class="col Header_3">
	<ul class="sidebar_list">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header Sidebar 3') ) { ?>
		<li class="widget">
			<div class="widget_box">
				<h3><?php _e('Header Sidebar 3', 'thesis'); ?></h3>
				<p>This is your new sidebar.  You can add widgets to it like normal using the Widgets Panel.</p>
			</div>
		</li>
<?php	}	?>
	</ul>
</div>


<div class="col Header_4">
	<ul class="sidebar_list">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header Sidebar 4') ) { ?>
		<li class="widget">
			<div class="widget_box">
				<h3><?php _e('Header Sidebar 4', 'thesis'); ?></h3>
				<p>This is your new sidebar.  You can add widgets to it like normal using the Widgets Panel.</p>
			</div>
		</li>
<?php	}	?>
	</ul>
</div>

<?php
}
add_action('thesis_hook_header', 'widget_header');

Initial URL
http://www.fouroclockproject.com

Initial Description
Adds two "sidebars" to the header.  You can drag and drop widgets into them just like any other sidebar from your WP dashboard.  You can change the Hook to move the "sidebars" somewhere else on the page.  For example, change 'thesis_hook_header' to 'thesis_hook_after_html' and your new sidebars will show up there.  Style using CSS to change their layout.

Initial Title
Widgetize Header, Footer and Everything Else Using Thesis' Hooks

Initial Tags
wordpress

Initial Language
PHP