Fatal error: Cannot redeclare class Custom_Image_Header
-
Just upgraded wordpress to 3.4 Got a fatal error
Fatal error: Cannot redeclare class Custom_Image_Header in /home/article/public_html/slimmers.co.nz/wp-admin/custom-header.php on line 16
It’s obviously to do with the theme.
Not sure what to do.
-
Switch to the TwentyEleven theme (and make sure you’re using the latest version thereof).
What theme is this? Can you link to it?
Yes, if you delete the theme it’ll revert to TwentyEleven.
writerwordpressthemedotcom
Two things to try.
1) Manually re-install WP
2) Delete the theme folder for whatever theme it was you were using.
Thanks all done. Cheers for your help.
Marked as resolved.
hello,
I’ve found another solution.
I wanted to stay with Back My Book theme, so, I’ve checked what had happened.
In file “../wp-content/themes/back-my-book/admin/custom-header.php” there’s a declaration of a class Custom_Image_Header. It overlaps class that already exists in WordPress Engine – that’s the reason of fatal error.
So, I’ve replaced name of this class to Custom_Image_Header_BMB (and other occurences – 3 occurrences all together in custom-header.php file), then I’ve renamed call to this class in “../wp-content/themes/back-my-book/functions.php” file.
Line number 98:
original:
————-
$GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback, $admin_image_div_callback);changed to:
————-
$GLOBALS['custom_image_header'] =& new Custom_Image_Header_BMB($admin_header_callback, $admin_image_div_callback);It worked for me. You can check it at http://henrykbaranowski.pl/
I’m not a programmer, only ‘home-made screwdriver’ ;-), so, if someone can check if that’s all – I’d be very glad for feedback.
Cheers,
ascetaasceta,
Thank you for your post! I also did not want to lose the Back My Book theme, and am very grateful for your insight. I’m not a programmer either and was at a loss.
I had to change the name of the custom_image_header line on a few other lines in functions.php, but after I did that – and after I re-activated all my plugins, all the error messages went away!
Amanda
Solved my problem. Kudos!
Thank you, Asceta. This fix worked for me.
Took a few attempts as Dreamweaver didn’t seem to like me trying to directly edit the files on the server, but once I chose to edit my local files instead and then PUT them on the server, it worked first time.
Brilliant!
Hello,
I just created WordPress, I succeed to log in, but than, I got a error : Fatal error: Class ‘Custom_Image_Header’ not found in /www/seri.be/public_html/wp-includes/theme.php on line 1360
I didn’t add my theme or any plug-in.
I tried through yours suggestion but it doesn’t work for me.
Anyone help me ? plz !
i got this error. please help me resolve it!!! i am using back my book theme.
Fatal error: Cannot redeclare class Custom_Image_Header in /home/booksfor/public_html/wp-admin/custom-header.php on line 16
booksforme.com.au
booksforme.com.au/wp-admin
If the solutions in this thread do not resolve your problem, then it is likely you are not experiencing the same problem; in which case it is best to create your own thread.
The topic ‘Fatal error: Cannot redeclare class Custom_Image_Header’ is closed to new replies.