How to remove "This is a child theme of xyz theme"

Hi,

1. I use child themes for all the themes in my network.

But in theme preview it displays a message

"This is a child theme of Stargazer."

Is there a mu-plugin way to hide this message for all the child themes?

2. In Edublogs.org, do you use child themes? If not,how do manage the footers "Powered by" "Theme by" etc etc for various themes?

  • Ash
    • WordPress Hacker

    Hello @ Aathithyan

    I hope you are well today and thanks for asking the question.

    Please use the following code.

    add_action( 'admin_head', 'hide_theme_desc' );
    function hide_theme_desc() {
    ?>
        <style>
        .theme-description{display: none !important;}
        </style>
    <?php
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag (<?php) at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Hello @Aathithyan

    Please replace my above code with the following:

    add_action( 'admin_head', 'hide_theme_desc' );
    function hide_theme_desc() {
    ?>
        <style>
        .parent-theme, .theme-description{display: none !important;}
        </style>
    <?php
    }

    Let us know if it works.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.