Skip to content

Instantly share code, notes, and snippets.

@studiopress
Last active June 24, 2021 21:01
Show Gist options
  • Save studiopress/5700110 to your computer and use it in GitHub Desktop.
Save studiopress/5700110 to your computer and use it in GitHub Desktop.
Genesis admin management.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar_sidebar' );
//* Force sidebar-sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_sidebar_content' );
//* Force sidebar-content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content_sidebar' );
//* Force full-width-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove Genesis menu link
remove_theme_support( 'genesis-admin-menu' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Unregister Genesis widgets
add_action( 'widgets_init', 'unregister_genesis_widgets', 20 );
function unregister_genesis_widgets() {
unregister_widget( 'Genesis_eNews_Updates' );
unregister_widget( 'Genesis_Featured_Page' );
unregister_widget( 'Genesis_Featured_Post' );
unregister_widget( 'Genesis_Latest_Tweets_Widget' );
unregister_widget( 'Genesis_Menu_Pages_Widget' );
unregister_widget( 'Genesis_User_Profile_Widget' );
unregister_widget( 'Genesis_Widget_Menu_Categories' );
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove Genesis in-post SEO Settings
remove_action( 'admin_menu', 'genesis_add_inpost_seo_box' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove Genesis Layout Settings
remove_theme_support( 'genesis-inpost-layouts' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove Genesis SEO Settings menu link
remove_theme_support( 'genesis-seo-settings-menu' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Unregister content/sidebar layout setting
genesis_unregister_layout( 'content-sidebar' );
//* Unregister sidebar/content layout setting
genesis_unregister_layout( 'sidebar-content' );
//* Unregister content/sidebar/sidebar layout setting
genesis_unregister_layout( 'content-sidebar-sidebar' );
//* Unregister sidebar/sidebar/content layout setting
genesis_unregister_layout( 'sidebar-sidebar-content' );
//* Unregister sidebar/content/sidebar layout setting
genesis_unregister_layout( 'sidebar-content-sidebar' );
//* Unregister full-width content layout setting
genesis_unregister_layout( 'full-width-content' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment