WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Fourteen
[resolved] Failed to load resource in child theme (image) (6 posts)

  1. Angelina Belle
    Member
    Posted 4 months ago #

    I created a child theme of twentyfourteen.

    Now, my browser gives me an error message:
    Failed to load resource ... /twentyfourteen%20child%20--%20p4p/images/pattern-light.svg

    It seems that this comes about because I made a copy of style.css in my child theme. I did this because, when I tried a style.css with just the header information, it appeared that the parent style.css was not loaded, so I concluded I needed to copy everything from style.css into the child theme.

    Apparently, that means that the .post-thumbnail background url(images/pattern-light.svg) needs to be loaded relative to the child theme, rather than the theme template.

    Is this a bug or a feature?

    If this is a feature, should the documentation in
    https://codex.wordpress.org/Child_Themes
    note that it is necessary to copy the parent images directory into the child theme?

  2. esmi
    Forum Moderator
    Posted 4 months ago #

    I made a copy of style.css in my child theme

    Why? Have you reviewed child themes?

    I'd also suggest that you remove the spaces from your child theme's folder name.

  3. Angelina Belle
    Member
    Posted 4 months ago #

    If I do not put any CSS in the child style.css, is the theme supposed to use the css from the parent style.css? That has not been my observation.

    I decided to start over, since I missed or ignored the part about spaces in linux directory names.

    Here is what I did:
    1) Created a child folder name (twentyfourteen-child--p4p this time)
    2) Created a style.css in the child folder name, with only the required header information, and no CSS yet.
    3)I activated the new child theme
    4)I observed the site -- appears to be no CSS applied.

    5) I copied all the CSS from the parent theme's style.css into the child theme's style.css.
    6) Observed the site again. Looks like the parent theme now. Except for the background url that cannot be loaded (see above).

    Is this a bug or a feature?

  4. stephencottontail
    Member
    Posted 4 months ago #

    When you make a child theme, in the child theme's style.css you typically import your parent theme's CSS like this: @import url('../twentyfourteen/style.css');. Then you put your customizations after that line.

    As for your image problem, it'll be fixed if you @import Twenty Fourteen's stylesheet like I suggested.

  5. Angelina Belle
    Member
    Posted 4 months ago #

    I suggest I actually learn to read :)

    Thanks for the tip.

  6. Angelina Belle
    Member
    Posted 4 months ago #

    Oops -- "resolved". thanks.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.