Created
July 17, 2014 17:43
-
-
Save Willem-Siebe/90654e8fdf5513c13771 to your computer and use it in GitHub Desktop.
Change sidebar widget values 'before' and 'after', see http://wp-types.com/forums/topic/missing-sidewide-sections-on-toolset-bootstrap/page/3/#post-132302.
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
// Change sidebar widget values 'before' and 'after', see https://gist.github.com/Willem-Siebe/90654e8fdf5513c13771. | |
function wsis_modify_before_widget_after_widget($params) { | |
if ($params[0]['id']=='header-widgets-search') { | |
if (strpos($params[0]['before_widget'],'nav_menu-14')) { | |
//Supposing you want to change the HTML to <ul> instead of <div> | |
$params[0]['before_widget']='<nav id="nav_menu-14" class="wsis-widget widget_nav_menu">'; | |
$params[0]['after_widget']='</nav>'; | |
} | |
} | |
return $params; | |
} | |
add_filter('dynamic_sidebar_params','wsis_modify_before_widget_after_widget'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment