Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created January 16, 2012 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/1623202 to your computer and use it in GitHub Desktop.
Save billerickson/1623202 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment