1

Could someone maybe explain to me how you can hide a parent theme in admin. I have been searching on the internet how to do this, but I can't seem to make it work. What is the correct code for it, and where do you put it?

I found this, but I don't understand it enough to make it work:

function kill_theme_wpse_188906($themes) {
  unset($themes['twentyten']);
  return $themes;
}
add_filter('wp_prepare_themes_for_js','kill_theme_wpse_188906');

kill_theme_wpse_188906 is that the parent theme name in this example? And code needs to be inserted in the functions.php of the child theme right?

I am sorry if this is a dumb question, but I am a bit stuck.

1 Answer 1

1

You should write the name of the theme as in the folder /wp-content/themes

For example, for hiding the default theme Twenty Fifteen you should write like this

function kill_themes($themes) {
  unset($themes['twentyfifteen']);
  return $themes;
}
add_filter('wp_prepare_themes_for_js','kill_themes');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.