siga
2/17/2017 - 1:41 PM

Add a custom search widget in two different places, depending on if it´s the frontpage or not.

Add a custom search widget in two different places, depending on if it´s the frontpage or not.

//* ============= Search Widget Area =========================
//* Register Custom Search area for Frontpage

genesis_register_sidebar( array(
'id' => 'sg-search',
'name' => __( 'SG Search', 'dynamik' ),
'description' => __( 'This is a custom search area.', 'dynamik' ),
) );

add_action( 'genesis_after_header', 'top_search', 25 );

function top_search() { 
if ( !is_front_page() )
genesis_widget_area( 'sg-search', array(
'before' => '<div class="customsearch wrap">',
'after' => '<div class="clearfix"></div></div>',
) ); 
}

add_action( 'genesis_before_footer', 'bottom_search', 5 );

function bottom_search() { 
if ( is_front_page() )
genesis_widget_area( 'sg-search', array(
'before' => '<div class="customsearch wrap">',
'after' => '<div class="clearfix"></div></div>',
) ); 
}