Last active
November 24, 2015 15:57
-
-
Save jasonyingling/01333107fed9900f5d93 to your computer and use it in GitHub Desktop.
Registering a Sidebar in WordPress
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
// Function to create widgetized area | |
function meetup_widgetized_area() { | |
$args = array( | |
'name' => __('Meetup Widgetized Area', 'sample-child'), | |
'id' => 'meetup-widgetized-area', | |
'description' => 'A sample widegetized area', | |
'class' => '', | |
'before_widget' => '<section id="%1$s" class="widget %2$s">', | |
'after_widget' => '</section>', | |
'before_title' => '<h2 class="widgettitle">', | |
'after_title' => '</h2>', | |
); | |
register_sidebar($args); | |
} | |
// Hook into the widgets_init() function and call our function to register our widgetized area | |
add_action( 'widgets_init', 'meetup_widgetized_area' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment