neilgee
5/14/2014 - 10:16 PM

Position Footer Widget With Conditional in Genesis

Position Footer Widget With Conditional in Genesis

<?php

//do not copy the opening php tag above
 
/**
 * Change ID in Genesis Menu
 * 
 * @package   Conditionally Add Genesis Footer
 * @author    Neil Gee
 * @link      http://coolestguidesontheplanet.com/create-footer-widget-area-genesis-child-theme/
 * @copyright (c) 2014, Neil Gee
 */

//Remove Existing Footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
	
//Add in new Widget areas
function genesischild_extra_widgets() {	
	genesis_register_sidebar( array(
		'id'          => 'footercontent',
		'name'        => __( 'Footer', 'genesischild' ),
		'description' => __( 'This is the general footer area', 'genesischild' ),
		'before_widget' => '<div class="footercontent">',
		'after_widget' => '</div>',
	) );
}

add_action( 'widgets_init', 'genesischild_extra_widgets' );	

	
//Position the Footer Area
function genesischild_footer_widget() {
	if ( is_front_page() ) {
	genesis_widget_area ('footercontent', array(
		'before' => '<div class="footercontainer">',
		'after' => '</div>',));
	}
}


add_action( 'genesis_footer','genesischild_footer_widget' );