Last active
February 16, 2020 11:58
-
-
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/
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 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