WordPress.org

Ready to get started?Download WordPress

Forums

Child theme on localhost not overwritting style.css (13 posts)

  1. enguyen23
    Member
    Posted 1 year ago #

    On my localhost using xampp, I've made a child theme and it works when footer.php is edited however any edits made to style.css does not.

    I dont' get it!? any suggestions? thanks

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Perhaps you need to add more specific selectors in your Child Theme stylesheet.

  3. enguyen23
    Member
    Posted 1 year ago #

    how much more specific can selectors be? do you have an example?

    for instance i'm just trying to change the body's background:

    body{
    background:#99000;
    }

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    What I do is use a Browser Inspector Tool to find the current styles' selectors, then use those same selectors in my Child Theme stylesheet.

  5. enguyen23
    Member
    Posted 1 year ago #

    you're right, there was a more specific selector:

    body.custom-background {}

    However it didn't work.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Custom background is likely set through an option in your theme.

  7. enguyen23
    Member
    Posted 1 year ago #

    custom background is set through theme option however other css items are not changing either. for instance, an h2 tag or p tags are not overriding.

    Funny thing is, all the php files seem to be working, but not the css files.

  8. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try adding !important to your styles and use the most specific (as necessary) selectors, to make-sure whether your styles are overriding.

  9. enguyen23
    Member
    Posted 1 year ago #

    Could it be theme related?

    The child theme that is giving me problems, stems from "Online Marketer" theme.

    I have a child them for "Responsive" and that one works w/ no issues.

  10. Andrew
    Forum Moderator
    Posted 1 year ago #

    Yes, CSS issues are likely to be theme-specific.

  11. enguyen23
    Member
    Posted 1 year ago #

    that's too bad. Wonder why or how!? seems like there has to be a workaround for this.

  12. Andrew
    Forum Moderator
    Posted 1 year ago #

    Your web browser may have cached your original stylesheet; try clearing your browser cache.

    It's difficult to resolve CSS issues without perceiving them.

  13. enguyen23
    Member
    Posted 1 year ago #

    I ended up choosing another theme.

    Although i'm saving the "online marketer" theme to play around w/ in a future time, hopefully finding a fix.

    thanks for all the help.

Topic Closed

This topic has been closed to new replies.

About this Topic