Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Last active December 12, 2015 03:29
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 BoweFrankema/4707552 to your computer and use it in GitHub Desktop.
Save BoweFrankema/4707552 to your computer and use it in GitHub Desktop.
The HTML for a 2nd sidebar in the CBOX Theme
// Alt Sidebar
function cbox_alt_sidebar() { {
if ( !bp_is_blog_page() ): ?>
<aside id="sidebar-alt">
<?php
if ( is_active_sidebar( 'alt-sidebar' ) ) {
dynamic_sidebar( 'alt-sidebar');
} else { ?>
<div class="widget"><h4>Alternative Sidebar.</h4>
<a href="<?php echo home_url( '/' ); ?>wp-admin/widgets.php" title="Add Widgets">Add Widgets</a></div><?php
}
?>
</aside>
<?php endif; }}
// Hook into action
add_action('open_main_wrap','cbox_alt_sidebar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment