How do I edit a css file? (7 posts)

  1. eolproductions
    Posted 2 years ago #

    I want to change a file but it is called: theme.min.css?ver=1367249842. I can only find a file called theme.min.css and when I do edit that it doesn't update. Any ideas?

  2. WPyogi
    Forum Moderator
    Posted 2 years ago #

    You shouldn't modify theme files directly - instead make changes using a Custom CSS option or plugin.

  3. eolproductions
    Posted 2 years ago #

    But the code that I need to change means that I will need to edit it directly.

  4. Michael
    Forum Moderator
    Posted 2 years ago #

    you seem to edit the right file (you can ignore the ?ver= part).

    what method are you using to edit the file?

    what theme are you using?

    what exactly do you need to change?

  5. John Regan
    Posted 2 years ago #

    WPYogi is right. You shouldn't edit Theme files directly, because if/when you update your theme, your changes will be overwritten.

    If you create a child theme of the theme you're currently using, you can overrule the styles that are in theme.min.css.

    Making a Child Theme isn't a difficult process once you understand how to do it. It's basically creating a folder and a css file.

    In your wp-content/themes/ folder, create a new folder called my-child-theme (or whatever you like). Inside that folder, create a file called style.css.

    In style.css, put the following header, with the appropriate edits:

    Theme Name:     my-child-theme [or whatever you want to call it]
    Theme URI:      http://example.com/
    Description:    Child theme for the [Your main Theme] theme
    Author:         Your name here
    Author URI:     http://example.com/about/
    Template:       twentytwelve [Put your main Theme's folder name here]
    Version:        0.1.0

    Then, in that style.css, include the following line:
    @import url("../[Main Theme's folder name]/style.css");
    this will pull in the CSS from the Main (Parent) Theme

    ...then add your css edits and save the file.

    After that, go to Appearance>Themes and activate your Child Theme.

    If that doesn't work, first check to see if your style.css is being pulled in at all (between the page's <head> tags). If it is, then your issue is with your css.

    If you still need help, I recommend checking out the Child Theme article, but if that doesn't help, let me know.

  6. eolproductions
    Posted 2 years ago #

    alchymyth - I am using the code editor in file viewer in cPanel. I am using the theme: Halfcreative. I just wanted to change some of the header colours, page widths and things like that.

  7. WPyogi
    Forum Moderator
    Posted 2 years ago #

    Any of those can be changed in custom CSS - it will OVERRIDE the existing CSS of your theme and won't be lost when the theme is updated.

    But since that's a commercial theme, please ask the developer for help:


Topic Closed

This topic has been closed to new replies.

About this Topic