Created
July 12, 2013 11:10
-
-
Save hlashbrooke/5983657 to your computer and use it in GitHub Desktop.
WordPress: Create a new widget area
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function register_widget_area() { | |
register_sidebar( array( | |
'name' => 'Widget Area Name', | |
'id' => 'new_widget_area', | |
'before_widget' => '<div class="widget">', | |
'after_widget' => '</div>', | |
'before_title' => '<h1 class="title">', | |
'after_title' => '</h1>', | |
) ); | |
} | |
add_action( 'widgets_init', 'register_widget_area' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php dynamic_sidebar( 'new_widget_area' ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment