Create a gist now

Instantly share code, notes, and snippets.

anonymous /as of 914 at 310 pm CT
Created Sep 14, 2012

What would you like to do?
LeeAnn's Revised customs_functions.php
register_sidebar(array(
'name' => 'Landing Page Sidebar',
'id' => 'marry-opt-in',
'before_widget' => '<li class="widget %2$s" id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Video 1 Page Sidebar',
'id' => 'marry-video-1',
'before_widget' => '<li class="widget %2$s" id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Video 2 Page Sidebar',
'id' => 'marry-video-2',
'before_widget' => '<li class="widget %2$s" id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Video 3 Page Sidebar',
'id' => 'marry-video-3',
'before_widget' => '<li class="widget %2$s" id="%1$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
function mysite_dynamic_sidebars() {
if(is_page('5')) {
mysite_do_sidebar('marry-opt-in');
}
if(is_page('8')) {
mysite_do_sidebar('marry-video-1');
}
if(is_page('10')) {
mysite_do_sidebar('marry-video-2');
}
if(is_page('12')) {
mysite_do_sidebar('marry-video-3');
}
else {
mysite_do_sidebar('marry-video-1');
}
}
add_action('thesis_hook_before_sidebar_1', 'mysite_dynamic_sidebars');
function mysite_do_sidebar($sidebar) {
if ( ! dynamic_sidebar($sidebar)) {
echo "\t\t\t\t\t<li>missing widget area: $sidebar</li>\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment