Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisdigital/4953469 to your computer and use it in GitHub Desktop.
Save chrisdigital/4953469 to your computer and use it in GitHub Desktop.
Sometimes when customizing a commercial Wordpress theme, you want to BLOW UP (remove) the theme options/settings and have your css files do the heavy lifting. Here's how to rip them out via your "child theme setup function."
// Naturally, this is relative to each theme,
// you're going to have to hunt to figure out
// what the items are called in your functions.php
// of parent theme or framework code
// theme prefix = most likely your theme folder name
// Read these threads for context...
// http://wordpress.org/support/topic/overriding-twentyeleven-theme-optionsphp
// http://stackoverflow.com/questions/8994887/how-to-remove-wordpress-theme-options-from-child-theme
// http://codex.wordpress.org/Function_Reference/remove_submenu_page
// Place the following in "child theme setup function" in your child functions.php
//--- Remove styles from parent theme options...
function remove_{theme prefix}_actions() {
remove_action('wp_head','{theme prefix}_style_settings');
}
add_action('init','remove_{theme prefix}_actions');
//--- Remove the menu item from the admin menu
function remove_{theme prefix}_theme_options() {
remove_submenu_page('themes.php', 'theme-settings');//might be called 'theme-options' in your theme
}
add_action('admin_init', 'remove_{theme prefix}_theme_options', 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment