Last active
November 23, 2015 20:31
-
-
Save WAcode27/7fe23d2258bd9f962c26 to your computer and use it in GitHub Desktop.
Remove Search Bar on Select Pages - Uses a Custom Body Class. See blog post on http://winningagent.com
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
<?php | |
//Remove line above; don't include it. | |
// Starting at line 157 in your functions.php, find this and comment out with /* */ as shown: | |
// Add search widget below header. | |
/*add_action( 'genesis_after_header', 'wap_search_bar' ); | |
function wap_search_bar() { | |
genesis_widget_area( 'search-bar', array( | |
'before'=> '<div class="search-bar"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
}*/ | |
// Add this just below the commented out code: | |
// Add search widget below header. | |
add_action( 'genesis_after_header', 'wap_search_bar' ); | |
function wap_search_bar() { | |
$body_classes = get_body_class(); | |
if ( !in_array( 'no-search-bar', $body_classes ) ) { | |
genesis_widget_area( 'search-bar', array( | |
'before' => '<div class="search-bar"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment