Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active February 16, 2020 11:58
Show Gist options
  • Save vanaf1979/db532934d79068881e062f6c71d81561 to your computer and use it in GitHub Desktop.
Save vanaf1979/db532934d79068881e062f6c71d81561 to your computer and use it in GitHub Desktop.
Gist for my "WordPress: Managing Your Theme's Footer With Widgets." tutorial/article on https://since1979.dev/wordpress-adding-widget-areas-to-your-themes-footer/
function register_widget_areas() {
register_sidebar( array(
'name' => 'Footer area one',
'id' => 'footer_area_one',
'description' => 'This widget area discription',
'before_widget' => '<section class="footer-area footer-area-one">',
'after_widget' => '</section>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
register_sidebar( array(
'name' => 'Footer area two',
'id' => 'footer_area_two',
'description' => 'This widget area discription',
'before_widget' => '<section class="footer-area footer-area-two">',
'after_widget' => '</section>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
register_sidebar( array(
'name' => 'Footer area three',
'id' => 'footer_area_three',
'description' => 'This widget area discription',
'before_widget' => '<section class="footer-area footer-area-three">',
'after_widget' => '</section>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
register_sidebar( array(
'name' => 'Footer area four',
'id' => 'footer_area_four',
'description' => 'This widget area discription',
'before_widget' => '<section class="footer-area footer-area-three">',
'after_widget' => '</section>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
}
add_action( 'widgets_init', 'register_widget_areas' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment