Hide body wallapaper in admin panel

  • Hi, i used an child theme and a modded style.css

    In the modded style.css the background image is defind by body class, the page text enclosed by layers ( css modded theme classes ).

    In the frontend everything is fine, but in the backend there is an issue:

    - The frontend layers were not shown in the MCE editor ( bad readable text )
    - The background image should only used in frontend => BG shown only in the div fields not the entire page background

    so i tried serveral sollutions :
    - override backroundimage via other used classes => not work because body BG is not adjustabe by other classes
    - searching for css/id/class differences bettween frontend body class and backend body class


    follwing the instructions overriding the background image from the body tag does not work:

    #-
    Assuming that you want the image on most page, you would add it in the Customizer (also assuming you can do this in your theme). Then identify a unique class name that is on the body tag for the pages that you do not want the image, and add CSS to the Customizer under Additional CSS for those classes.

    Finding the class names: you use your browser by either Viewing Source or the Developer Tools (Right click and choose Inspect Element). Find the <body> tag and look at the class names listed there. Some will be unique, like post-123 or category-xyz.

    Once you have some class names for the pages, the CSS to add looks like this:
    .post-123, .category-xyz {background-image: none;}
    Note that in CSS, class names are denoted by a leading dot. You separate the classes with a comma.
    #-

    I dont know what i can do or search for. Is it possible to create an body class for frondend and another one for backend ?

    Can i override the background image from body by a sub class or another class ?


    EDIT : the background image in the editor is loaded by the iframe tag - does CSS not work when using iframes ?

    2 Mal editiert, zuletzt von speefak (4. Oktober 2022 um 16:13)

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Solution :

    add CSS code in your childtheme ( style.css )

    /
    [PLAIN]* Global backgroundimage body.<use not listet class in admin panel> */
    body.czr-sticky-footer {
    background: url(https://path/to/picuture.jpg) repeat center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    }

    /* disable background in admin panel body.<use only listet class in admin panel> */
    body.wp-admin {
    background: none;
    }[/PLAIN]

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!