Skip to content

Instantly share code, notes, and snippets.

@jayseventwo
Created May 23, 2013 04:58
Show Gist options
  • Save jayseventwo/5632842 to your computer and use it in GitHub Desktop.
Save jayseventwo/5632842 to your computer and use it in GitHub Desktop.
Create a custom widget area.
// add to functions.php
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Right header',
'id' => 'custom-widget-01',
'description' => 'Widget Area',
'before_widget' => '<div id="one" class="two">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
// add to theme
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right header') ) : ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment