I am trying to create a child theme based on Twenty Ten… created child theme directory in themes directory, upload new style.css which includes new child theme name, parent theme template, etc, all properly commented as in twentyten parent theme). Change WP theme to Child theme which shows unstyled html as it should as I haven’t @imported parent theme style.css yet. So far, so good.
So I add @import url(“…themes/twentyten/style.css”); to my child theme style.css immediately after the commented out info, save the file and … nothing happens! The HTML is still unstyled; it seems that the parent theme (twentyten) has not imported at all!
Puzzling. I refreshed the browser, checked in alternate browsers, refreshed, restarted the computer and still only displays unstyled html.
Thank, Molona, for your suggestion. I have done it that way in the past but I prefer to use a child theme to preserve my style modifications in the event that the parent theme is updated.
Sorry but I fail to understand. If you copy the CSS file and paste it in the folder your child theme is, your child them will preserve your modifications even if the parent is updated. WP always look at the folder where the child theme, and if it doesn’t find the file with the expected name, then uses the parent’s.
This is so bizarre! I simply deleted and re-uploaded the stylesheet to the server (for about the 15th time!) and finally the @import of the parent theme css works. I made no changes to the stylesheet from my other attempts. Go figure.
The reason I chose to use a child theme is so that I can create a separate stylesheet containing only my modifications and still benefit from updates to the parent theme without my customizations being overridden by the updates.
Probably you were seeing a cached version of your page. It happens. When you see something bizarre like this, clean your cache and reload.
Now, regarding what I meant, let me explain myself with an example. Maybe it will be easer to understand.
Let’s say that your parent theme has a page called contact.php and you want that page to be different but you don’t want to loose the original version.
Then, in your child theme, you will create a page called contact.php. The only difference will be that it is in your child theme’s folder.
When someone in your site clicks to open contact.php, WP will look first in the folder of your child theme and search for contact.php and, if it doesn’t find it, then it will look for it in your parent’s theme.
In this way, if you update the parent theme, your child theme does retain the changes.
Haven’t a lot of people been having issues with WP 3.1 lately? with upgrading to it. I think it is wordpress’ biggest change/overhall with 3.1.xx vs any other update?