public
Created

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Index: lib/functions/general.php
===================================================================
--- lib/functions/general.php (revision 557)
+++ lib/functions/general.php (working copy)
@@ -125,4 +125,18 @@
return false;
+}
+
+add_action( 'genesis_theme_settings_metaboxes', 'genesis_remove_default_widgets_from_header_right' );
+/**
+ * Remove Default Widgets from Header Right
+ *
+ */
+function genesis_remove_default_widgets_from_header_right() {
+ $widgets = get_option( 'sidebars_widgets' );
+ $defaults = array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', );
+ if( $defaults == $widgets['header-right'] ) {
+ $widgets['header-right'] = array();
+ update_option( 'sidebars_widgets', $widgets );
+ }
}
\ No newline at end of file

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.