CSS

  • Author
    Posts
  • #122584

    Can I separate the individual theme in the CSS?
    My problem is if I change something in the “Simple CSS” it works on all 4 themes.
    For each Theme (Tempera, Parabola, Mantra, Nirvana), I would like to address its own CSS or better a CSS the theme separately, for example, with an ID or class in one CSS document. Is that feasible?
    And of course it should not be overwritten with an update.

    Website: www.oelart.de

    #123403
    Zed
    Cryout Creations mastermind

    Hi,

    The theme’s don’t add theme specific classnames or identifiers to the markup. However you should be able to do this by writing some custom (PHP) code to append the theme’s slug as an additional class to the document body tag:

    function my_body_class( $classes ) {
       $classes[] = 'theme-' . esc_attr( get_template() );
       return $classes;
    }
    add_filter( 'body_class', 'my_body_class' );

    https://developer.wordpress.org/reference/hooks/body_class/
    https://developer.wordpress.org/reference/functions/get_template/


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #123797

    Hello Zed,

    thank you, very helpful the information.

    best regards

    Website: www.oelart.de

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘CSS’ is closed to new replies.