Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is my first attempt at creating a child theme based off the WP twentyeleven theme.

To begin with, I am using MAMP on my mac and have the following directory structure:

 applications/MAMP/htdocs/mysite/wp-content/themes/twentyeleven/style.css
                                                  /mytwentyeleven/style.css

My URL in my browser appears as: http://localhost:8888/mysite/

My problem/query is, when I activate my theme within WP 3.2 and then go and view it, there is no style been applied at all and the header and footer don't appear either.

Based on my directory structure above, I am thinking my style.css within my mytwentyeleven directory is not importing original parent twentyeleven style.css file.

I think my import path is wrong or perhaps something else. Again, this is my first time at creating a child theme.

Here is my child theme style.css file contents:

/*
Theme Name: MyTwentyEleven Theme
Author: Me
Description: My TwentyEleven Child Theme CSS
Template: twentyeleven
*/
@import url("../twentyeleven/style.css");

Can people please let me know what I have missed as the import url path is not working as from the looks of it, it's not finding the parent twentyeleven style.css file.

Not sure if it's a MAMP thing but I just can't seem to see why it's not working/finding correct path back to parent stylesheet file.

Thanks

share|improve this question
    
This doesn't appear to be a WordPress question. Does your Child Theme work on a live server, but not on your local MAMP stack? –  Chip Bennett Aug 31 '11 at 13:12
    
@Chip Bennett - sorry, do not have access to a live server and not sure why you think that this is not a WordPress query - it's to do with child themes, which is my first attempt. Can you see anything wrong with my style.css file at all? Thanks. –  tonsils Aug 31 '11 at 13:21
    
I can't necessarily tell from the paths you posted.... is your child theme in the themes directory, or in the twentyeleven directory? It should be in themes, alongside twentyeleven –  Rev. Voodoo Aug 31 '11 at 14:16
    
A CSS @import question is a CSS question, and not specifically WordPress-related. It might be a WordPress-related question, if you don't have the parent-child relationship working properly. Can you verify that TwentyEleven is installed, and when activated, displays properly? –  Chip Bennett Aug 31 '11 at 14:22
1  
Without seeing what else is in your resulting markup, there's no way to debug this problem. Do you have ANY other files in the child theme? To start, you should ONLY have a style.css file. Not an index.php or anything else. –  Otto Aug 31 '11 at 16:16

2 Answers 2

your @import doesn't look malformed. this is what i have on a live site that is running a twenty eleven child theme.

/*   
Theme Name: A Twenty Eleven Child Theme
Description: my child theme
Author: helgatheviking
Template: twentyeleven
Version: 1.0

*/

/* Reset browser defaults */
@import url('../twentyeleven/style.css');

so assuming that twentyeleven is in the same folder wp-content/themes as your child theme... this should work. did you clear your cache?

share|improve this answer

Since:

  1. Twenty Eleven renders properly
  2. Your Child Theme is visible in Dashboard -> Appearance -> Themes
  3. Your Child Theme can be successfully activated
  4. The browser-rendered output of your Child Theme displays the Twenty Eleven markup
  5. Your @import call is failing in your Child Theme stylesheet

I suspect that you have a mal-formed @import call in your Child Theme's style.css, or else you have a file-permissions/configuration setup problem with your MAMP stack.

In either case, this doesn't appear to be a WordPress issue; WordPress is working properly.

share|improve this answer
    
if it's a permission issue with MAMP, would appreciate some guidance on what to check/how to fix - thanks. –  tonsils Sep 1 '11 at 0:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.