WordPress.org

Ready to get started?Download WordPress

Forums

Overrule framework.css in Child theme (4 posts)

  1. NvanMJ
    Member
    Posted 2 years ago #

    Is it possible to use a framework.css in a WordPress Child Theme to overrule the original framework.css? Just as the other items like style.css?

    I've made some changes but they only work when I adjust the original framework.css.

  2. Digital Raindrops
    Member
    Posted 2 years ago #

    It would depend on the theme, some themes load styles directly into the header.

    you can make the new styles !important;

    HTH

    David

  3. Per Sandström
    Member
    Posted 2 years ago #

    To override the framework.css in Blaskan with your own framework.css in your child theme add this code to the functions.php file in your child theme:

    function blaskan_css_init() {
      if ( !is_admin() && !in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-signup.php', 'wp-register.php' ) ) ) {
        wp_enqueue_style( 'blaskan-framework', get_stylesheet_directory_uri() . '/framework.css', array(), false, 'screen' );
        wp_enqueue_style( 'blaskan-style', get_bloginfo('stylesheet_url'), array(), false, 'screen' );
      }
    }
  4. NvanMJ
    Member
    Posted 2 years ago #

    Thnx David, Per!

    Didn't tought about !important, but it works in some themes. The code from Per works perfect for my Blaskan-based theme, ;).

Topic Closed

This topic has been closed to new replies.

About this Topic