WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cannot access WP admin or anything else after attempting to create child theme (4 posts)

  1. fierce
    Member
    Posted 1 year ago #

    This is the error I am getting:

    Fatal error: Cannot redeclare znn_customstyle() (previously declared in /home/fierce/public_html/wp-content/themes/zenon-lite-2/functions.php:21) in /home/fierce/public_html/wp-content/themes/zenon-lite/functions.php on line 60

    I was attempting to create a child theme using the one-click child plugin but it kept giving me errors. I have read other posts and used my host to delete the entire child theme and its contents but I am still getting this error and can't access anything.

    Please help!!

  2. I would try deleting the theme and then re-installing it. If it was working before, hopefully a fresh copy will be able to bring your site to what it was before.

    If you try to make a child theme again, I would try to avoid having a new copy of functions.php in the child theme. Functions.php are quite picky and can really cause havoc.

  3. fierce
    Member
    Posted 1 year ago #

    Thanks for the help.

    I did manage to delete the theme and re-install with no issues.

    Still unsure about the best way to create a child theme though...

  4. The best way to create a child theme is only to have a style.css in your child theme folder.

    If you want to change some of the functions which are set in your partent theme, then you can't simply copy the functions.php file from the parent theme and put it in your child theme.

    Instead you need to override the specific function.

    Have a look at this tutorial which uses Twenty Ten. It might point you in the right direction.
    http://wp.tutsplus.com/tutorials/theme-development/creating-a-simple-child-theme-using-twenty-eleven/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.