Skip to content

Instantly share code, notes, and snippets.

@colegeissinger
Created April 27, 2014 23:14
Show Gist options
  • Save colegeissinger/11357833 to your computer and use it in GitHub Desktop.
Save colegeissinger/11357833 to your computer and use it in GitHub Desktop.
This code is to be used in your theme. First block is to go in your functions.php then the last block is to be set where you want the widgetized area to be displayed.
/**
* Register our sidebars and widgetized areas.
* Add this block to your functions.php
*
*/
function arphabet_widgets_init() {
register_sidebar( array(
'name' => 'Home right sidebar',
'id' => 'home_right_1', // Take note of the ID! We'll need this to call the right widgetized area in our theme
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
/**
* Defines the location of where our widgetized area will be displayed
* Add this to your theme file where you wish to display this.
* If you want to display this in the footer, add it in the right spot in footer.php
*/
<?php dynamic_sidebar( 'home_right_1' ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment