Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active April 29, 2021 22:22
Show Gist options
  • Save srikat/70814344274fb2efe130 to your computer and use it in GitHub Desktop.
Save srikat/70814344274fb2efe130 to your computer and use it in GitHub Desktop.
CSS for Multi-Column Footer Widgets in Genesis. http://sridharkatakam.com/css-multi-column-footer-widgets-genesis/
//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );
/* 2-column Footer Widgets
--------------------------------------------- */
.footer-widgets-1,
.footer-widgets-2 {
width: 47.5%; /* 570px / 1200px */
float: left;
}
.footer-widgets-1 {
margin-right: 5%; /* 60px / 1200px */
}
@media only screen and (max-width: 768px) {
.footer-widgets-1,
.footer-widgets-2 {
width: 100%;
}
.footer-widgets-1 {
margin-right: 0;
}
}
/* 3-column Footer Widgets
--------------------------------------------- */
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3 {
width: 30%; /* 360px / 1200px */
float: left;
}
.footer-widgets-1,
.footer-widgets-2 {
margin-right: 5%; /* 60px / 1200px */
}
@media only screen and (max-width: 768px) {
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3 {
width: 100%;
}
.footer-widgets-1,
.footer-widgets-2 {
margin-right: 0;
}
}
/* 4-column Footer Widgets
--------------------------------------------- */
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4 {
width: 22%; /* 264px / 1200px */
float: left;
}
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3 {
margin-right: 4%; /* 48px / 1200px */
}
@media only screen and (max-width: 1024px) {
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4 {
width: 47.5%; /* 456px / 960px */
}
.footer-widgets-1,
.footer-widgets-3 {
margin-right: 5%; /* 48px / 960px */
}
.footer-widgets-2,
.footer-widgets-4 {
margin-right: 0;
}
}
@media only screen and (max-width: 568px) {
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4 {
width: 100%;
}
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3 {
margin-right: 0;
}
}
/* 5-column Footer Widgets
--------------------------------------------- */
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4,
.footer-widgets-5 {
width: 16.6666666667%; /* 200px / 1200px */
float: left;
}
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4 {
margin-right: 4.1666666667%; /* 50px / 1200px */
}
@media only screen and (max-width: 1024px) {
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4,
.footer-widgets-5 {
width: 47.7083333333%; /* 458px / 960px */
}
.footer-widgets-1,
.footer-widgets-3 {
margin-right: 4.5833333333%; /* 44px / 960px */
}
.footer-widgets-2,
.footer-widgets-4 {
margin-right: 0;
}
}
@media only screen and (max-width: 568px) {
.footer-widgets-1,
.footer-widgets-2,
.footer-widgets-3,
.footer-widgets-4,
.footer-widgets-5 {
width: 100%;
}
.footer-widgets-1,
.footer-widgets-3 {
margin-right: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment