Skip to content

@billerickson /gist:1623202
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.