Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tigrish/298726 to your computer and use it in GitHub Desktop.
Save tigrish/298726 to your computer and use it in GitHub Desktop.
<?php
register_sidebar(array('name' => 'Home', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Contact', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Page', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Post', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
function is_contact() {
return in_array('is_contact', get_post_custom_keys());
}
function sidebar_widgets() {
echo '<div class="aside main-aside"><ul class="xoxo">';
if (is_front_page()) { dynamic_sidebar('Home');
} elseif (is_contact()) { dynamic_sidebar('Contact');
} elseif (is_page()) { dynamic_sidebar('Page');
} else { dynamic_sidebar('Post'); }
echo '</ul></div>';
}
add_action('thematic_abovemainasides', 'sidebar_widgets');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment