• Resolved gulliver

    (@gulliver)


    My style.css file has an @import “css/master.css”; directive to import from elsewhere in the theme directory.

    It’s always worked fine until recently, when sometimes it doesn’t load the css – whereupon the source shows <style>@import url(path removed) ;</style> rather than <link rel=”stylesheet” type=”text/css” href=”path removed”/>. I notice that the former is a local path (and incorrectly minus the leading slash to denote the root) whereas the latter is the full http url.

    header.php has the usual <link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” />.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Clear server and local browser cache.

    Your themes should be in folders in your Themes folder in wp-content. So if you have two themes, say Parent and Child, they would both be in folders in /wp-content/themes/ subdirectory, such as /wp-content/themes/ParentTheme and /wp-content/themes/ChildTheme. The two themes are in a sister relationship, but in WordPress, the concept of a child theme is one that pulls style information in from the parent theme using an import statement. The openeing information of your child theme should look like this example:

    /*
    Theme Name: ChildTheme
    Template: ParentTheme
    Description: Child theme
    Author: Me
    Author URI: http://wow.mythemes.wow
    */
    
    @import url("../ParentTheme/style.css");

    Be sure that your syntax of the @import URL is correct. In this case, the Template the child theme is looking for is the name of the folder where the style.css is located for the Parent theme.

    Thread Starter gulliver

    (@gulliver)

    Thanks to you both.

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

The topic ‘Not importing css’ is closed to new replies.