WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] cant link to child theme style.css file (19 posts)

  1. dvir0776
    Member
    Posted 1 year ago #

    Hi, what's up?

    So I have created a child theme called twentytwelveschild
    and created a css file inside of it called style.css
    I activated this theme, but my website (www.betterpurpose.com)
    won't link to it. help!

    So I know why it's happening but I don't know how to fix it.
    The problem is the website links to style.css?ver=3.5
    instead to simply style.css

    heres the complete link:
    href="http://www.betterpurpose.com/wp-content/themes/twentytwelvechild/style.css?ver=3.5"

    what do i do?

    Thanks alot!

    Dvir

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Use Codex's Child Theme guidelines for reference to how to correctly create a Child Theme style.css file
    http://codex.wordpress.org/Child_Themes#Example_of_a_basic_Child_Theme

  3. So I have created a child theme called twentytwelveschild

    That's good. ;)

    The link http://www.betterpurpose.com/wp-content/themes/twentytwelvechild/style.css?ver=3.5 only has this line in it:

    @import url('../twentytwelve/style.css');

    This looks not quiet right. This is what I have in mine and that works without any problems.

    /*
    Theme Name: Twenty Twelve Child Theme
    Author: Self-Help WordPress User
    Template: twentytwelve
    */
    
    @import url("../twentytwelve/style.css");

    Or am I missing something? Your site looks looks like Twenty Twelve to me.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Nevermind this post, I misread Jan's comment.

  5. I misread Jan's comment.

    That happens to me aaallll the ttiiimmeee... ;)

  6. dvir0776
    Member
    Posted 1 year ago #

    First of all, thanks for your answers!

    but I'm still stuck lol, I tried to read the Codex's Child Theme guidelines but still they don't add anything there about how to change the version so the prbolem remains, any further help please?

  7. It's not you, it's me: I don't understand what you're trying to do. ;)

    The ver=3.5 in href="http://www.betterpurpose.com/wp-content/themes/twentytwelvechild/style.css?ver=3.5" is from the WordPress version. That's the normal behavior for any theme you use.

    Do you want to add a custom query string to the CSS URL? There's an article for that that escapes my Search Engine fu at the moment.

  8. dvir0776
    Member
    Posted 1 year ago #

  9. Perhaps it's your browser cache? Each of those links opened up the same one line file for me...

    I even tried by using the command line curl command. Identical results for each link (curl does not have a cache).

  10. dvir0776
    Member
    Posted 1 year ago #

    that is REALLY weird.

    So my website loads the css file when you visit it
    or it doesnt?

    I emptied my cache, still only 2 links from the ones above worked
    the one that didnt is this one

    http://www.betterpurpose.com/wp-content/themes/twentytwelvechild/style.css?ver=3.5

    when I open it I see an empty file, no one line for me :(

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Unless I'm missing something, your site looks like it's working fine. Have you put any styles in the child theme stylesheet? If not, it should be empty.

    EDIT -- not totally empty -- but it should only contain the commented stuff and the @import line.

  12. dvir0776
    Member
    Posted 1 year ago #

    thats it, I did put a style in my child theme
    my question is if you see it when the site loads
    up or is it with no css at all?

    Thanks!

  13. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    No, you are right, I don't see any styles. But do you have all of this in the style.css file in the child theme?

    /*
    Theme Name: Twenty Twelve Child Theme
    Author: Self-Help WordPress User
    Template: twentytwelve
    */
    
    @import url("../twentytwelve/style.css");
  14. dvir0776
    Member
    Posted 1 year ago #

    yesyesyse i do! thats the problem

    you see, the linking is correct inside the css file my
    problem is that when the site tries to load the css file
    it tries to access it via
    ../themes/twentytwelvechild/style.css?ver=3.5

    which DOESNOT work sadly. instead i want it to try load it like this
    ../themes/twentytwelvechild/style.css

    simply without the ?ver=3.5 part at the end.
    any ideas?

    I'm really frustrated about it

  15. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Try downloading a twentytwelve child theme from here:

    http://quirm.net/themes/twenty-twelve-child/

  16. dvir0776
    Member
    Posted 1 year ago #

    OMGOMGOMG
    IT WORKED!!!! IT'S ALIVE *creepy maniac laugh* ALIVE!

    lol, thank you so much, such a simple solution,
    you sir, just made my day!

    and as a reward, you should have a suprise link!
    (no virus i promise!)

    http://inciswf.com/z0r-de_3714.swf

    Thanks again,
    Dvir

  17. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    LOL - very cute, thanks! (FWIW, I'm female :))

    Glad it worked -- who knows what theme gremlins get in there sometimes. FYI, that child theme is courtesy of esmi (regular mod around here) so thanks really to to her.

    Now you're off and running...happy holidays!

  18. OMGOMGOMG
    IT WORKED!!!! IT'S ALIVE *creepy maniac laugh* ALIVE!

    Group hug everyone. The link is cute. ;)

    dvir0776 do you mind marking this resolved in the right column? WPyogi and Andrew get I-totally-made-up non-exchangeable thanks-for-all-you-do-here credit points when you do.

    I use my points in the (imaginary) WordPress cafeteria for getting a free slice of strawberry cheese cake.

  19. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Ha Ha! Are the points good for coffee?? (It's 7 am here -- and raining cats and dogs, coffee needed badly...)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags