Created
October 4, 2015 21:31
-
-
Save jimmy89Li/4e266529f4481c9ce42c to your computer and use it in GitHub Desktop.
WordPress footer with 3 widget areas
This file contains hidden or 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 widgets_init(){ | |
// First footer widget | |
register_sidebar(array( | |
'name' => 'Footer widget 1', | |
'id' => 'footer-widget-1', | |
'description' => 'The first footer widger area', | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
)); | |
// Second footer widget | |
register_sidebar(array( | |
'name' => 'Footer widget 2', | |
'id' => 'footer-widget-2', | |
'description' => 'The second footer widget area', | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
)); | |
// Third footer widget | |
register_sidebar(array( | |
'name' => 'Footer widget 3', | |
'id' => 'footer-widget-3', | |
'description' => 'The third footer widget area', | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_title' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
)); | |
} |
This file contains hidden or 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
/* centering */ | |
.fatfooter{text-align:center;} | |
/* floating */ | |
.one-third, .half { | |
float:left; | |
} | |
/* sizing */ | |
.one-third{ | |
width:32%; | |
} | |
.half{ | |
width:48%; | |
} | |
/* margining */ | |
.one-third{ | |
margin:0 0.5%; | |
} | |
.left, .one-third.left{ | |
margin:0 1% 0 0; | |
float:left; | |
} | |
.right, .one-third.right{ | |
margin:0 0 0 1%; | |
float:right; | |
} | |
.half.left{ | |
width:48%; | |
margin:0 2% 0 0; | |
} | |
.half.right{ | |
width:48%; | |
margin:0 0 0 2%; | |
} | |
/* media queries for small screens in landscape mode (or similar) */ | |
@media screen and ( max-width: 600px ) { | |
/* width sizing all full width in small screens */ | |
.one-third, | |
.half, | |
.full-width { | |
width:100%; | |
margin:0; | |
} | |
/* padding adjustments */ | |
.widget-area { | |
padding:0 0 10px 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment