Last active
August 29, 2015 14:05
-
-
Save hellofromtonya/5ea51a6ee899e99bc04c to your computer and use it in GitHub Desktop.
Add column class to each of the Genesis Footer Widgets
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
add_filter('genesis_footer_widget_areas', 'lunarwp\add_columns_to_footer_widgets', 10, 2); | |
/** | |
* Add column class to each of the footer widgets | |
* | |
* @since 1.0.0 | |
* | |
* @param string $output HTML output for the footer widgets | |
* @param string $footer_widgets | |
* @return string Return the amended $output | |
*/ | |
function add_columns_to_footer_widgets($output, $footer_widgets) | |
{ | |
//* Use one-third when you have 3 widgets; otherwise, adjust to the number of widgets you have. | |
//* For example, 2 = one-half and 4 = one-fourth. | |
$output = str_replace('widget-area', 'widget-area one-third', $output); | |
$output = str_replace('footer-widgets-1 widget-area one-third', 'footer-widget-1 widget-area one-third first', $output); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment