Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active August 29, 2015 13:58
Show Gist options
  • Save neilgee/10002281 to your computer and use it in GitHub Desktop.
Save neilgee/10002281 to your computer and use it in GitHub Desktop.
Replace Old Genesis Footer for a Left/Right New One
<?php
/**
* Remove Old Genesis Footer for a Left/Right New One
*
* @package Genesis Footer Switcheroo
* @author Neil Gee
* @link http://coolestguidesontheplanet.com/create-footer-area-left-right-widgets-genesis-child-theme/
* @copyright (c) 2014, Neil Gee
*/
//Add in new Widget areas
function genesischild_extra_widgets() {
genesis_register_sidebar( array(
'id' => 'footerleft',
'name' => __( 'Footer Left', 'genesischild' ),
'description' => __( 'This is the footer left area', 'genesischild' ),
'before_widget' => '<div class="first one-half footerleft">',
'after_widget' => '</div>',
) );
genesis_register_sidebar( array(
'id' => 'footerright',
'name' => __( 'Footer Right', 'genesischild' ),
'description' => __( 'This is the footer right area', 'genesischild' ),
'before_widget' => '<div class="one-half footerright">',
'after_widget' => '</div>',
) );
}
add_action('widgets_init', 'genesischild_extra_widgets');
//Remove The Old Footer
function genesischild_oldfooter() {
remove_action('genesis_footer', 'genesis_do_footer');
}
add_action('genesis_setup','genesischild_oldfooter');
//Add the New Footer
function genesischild_newfooter() {
genesis_widget_area ('footerleft',array(
'before' => '<div class="leftfoot">',
'after' => '</div>',));
genesis_widget_area ('footerright', array(
'before' => '<div class="rightfoot">',
'after' => '</div>',));
}
add_action('genesis_footer','genesischild_newfooter');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment