• Just created a child theme, as I had made some modifications to a theme that I didn’t want to lose. I copied all the themes files into a different directory and reinstalled the theme. now I get this error –
    Fatal error: Cannot redeclare register_scripts() (previously declared in /homepages/23/d236124545/htdocs/wp-content/themes/childbelle/functions.php:16) in /homepages/23/d236124545/htdocs/wp-content/themes/belle/functions.php on line 27

    can’t think what might be causing it, especially as I replaced the functions.php file only yesterday

    Edit: Moved all the files back into original directory (including modified child theme style.css file, and its all working again.
    What is going on? and if the theme is updated will i still lose my modifications?

Viewing 15 replies - 16 through 30 (of 33 total)
  • In your Child Theme’s style.css:

    @import url("path/to/colorscheme.css");

    Note that @import calls must come before any style definitions, or they will be ignored.

    Thread Starter dbphte1

    (@dbphte1)

    i’ll give that a try.

    Thread Starter dbphte1

    (@dbphte1)

    do i need to use the full url?

    No; it can be a relative path.

    Thread Starter dbphte1

    (@dbphte1)

    my path goes back this far – wp-content/themes/childbelle/colorstyles/blue.css
    its now showing up as a rule in firebug, but when i examine the footer the source url hasn’t changed to what was in the file i’ve directed it to.
    the blue.css files were in a different directory, and i still don’t know how exactly they work.

    The path is relative to the CSS file, which for your Child Theme is wp-content/themes/childbelle/style.css

    So, you would use: @import url("/colorstyles/blue.css");

    Thread Starter dbphte1

    (@dbphte1)

    @import url(“/colorstyles/blue.css”) is showing up in firebug, but its not affecting the page. any ideas?

    Where did you put your @import call in your style.css file?

    Thread Starter dbphte1

    (@dbphte1)

    before /*----general classes

    That doesn’t really help, because I don’t know what else is in your style.css file.

    Thread Starter dbphte1

    (@dbphte1)

    oh right, looked kinda standard to me

    /*
    Theme Name: Bellechild
    Theme URI:
    Description: like this - Simple, Light, clean XHTML web 2.0 WordPress Theme with Custom header and Theme options witch include a color scheme picker that allow you to pick from your choice of orange, red, blue, green, or yellow color schemes. You can also include custom social links like twitter or facebook.
    Version: 1.7
    Author: me
    Author URI:
    Template:       belle
    Version:        0.1.0
    */
    
    @import url("/colorstyles/blue.css");
    
    /*--------------------General Classes---------------*/
    body {
    	background: #ffffff url("images/body.jpg") repeat-x top left;
    	padding: 0px 0px 40px;
    	margin: 0px;
           font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Helvetica, Arial, sans-serif;
    	font-size:12px;

    thats the first few lines

    That should work. When you view the browser-output CSS file, do you see the style definitions from blue.css listed?

    The other issue might be that the rest of the stylesheet is overriding the definitions in blue.css.

    I would recommend using @import to pull in the Parent Theme’s style.css, and then using @import to pull in blue.css.

    That way, you don’t need to list the entire Parent Theme style.css in the Child Theme’s style.css; you only need to list anything you’re overriding.

    Thread Starter dbphte1

    (@dbphte1)

    i don’t think there is anything overriding blue.css, the other day i was trying to change the colours but couldn’t find anything in style.css.
    In the browser i see the blue.css definitions, but the directory has magically reappeared. i’ll check that its definitely the parent blue.css thats controlling things, then i’ll try importing them both.

    Thread Starter dbphte1

    (@dbphte1)

    its displaying all down the left hand side now, and the bit i changed in blue.css now has no style rule.
    just to confirm, i was @importing /parent/style.css and /child/colorstyles/blue.css ?

    Yes, but the path to the parent’s style.css will be: ../parenttheme/style.css

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘child theme – fatal error, seemed to be fine before’ is closed to new replies.