• Resolved WebsitesPro

    (@websitespro)


    Hi, i created today a child theme, and at the beginnig all was good but then i was editing functions.php and the page fall, this is the link http://nuevo.luissomaza.com/ ,the template i use is Syndey from Athemes.
    This is the error Fatal error: Cannot redeclare class Sydney_Latest_News in /home/luissoma/public_html/nuevo/wp-content/themes/sydney/widgets/fp-latest-news.php on line 131

    I created the child theme because i needed to add more entries at the section latest news, i follow the insturctions for the support of the page, but then happen the error, and i have wait all the day for an anwser but they are not responding now.

    The error has change a few times because i tried to fix it uploading the original archives again, but the only thing that change is the error and the line that says or the directory.

    What can i do??

    Please i really need help, my boss is gonna kill me if he see the page is dawn.

Viewing 15 replies - 1 through 15 (of 29 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    How did you create a Child Theme? What files were involved?

    Thread Starter WebsitesPro

    (@websitespro)

    I follow this instructions than the other support sends me, i did it all but when i was in the fifth step all fall.

    Here is the steps:
    1. create a child theme
    2. duplicate widgets/fp-latest-news.php from your parent theme to your child theme
    3. open and edit fp-latest-news.php within your child theme change this line 'posts_per_page' => 3, to 'posts_per_page' => 6,
    4. open and edit functions.php within your child theme then add this line:
    if ( function_exists('siteorigin_panels_activate') ) {
    require_once get_template_directory() . "-child/widgets/fp-latest-news.php";
    }

    5. open and edit fp-latest-news.php within your parent theme then change this line: require_once get_template_directory() . "/widgets/fp-latest-news.php";
    to // require_once get_template_directory() . "/widgets/fp-latest-news.php";

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    2. duplicate widgets/fp-latest-news.php from your parent theme to your child theme

    Whoa that’s probably the thing that has broken your website. Can you remove this file (from your child theme)?

    Thread Starter WebsitesPro

    (@websitespro)

    For the child theme i created a folder named sydney-child, i created a style.css in here that redirect from the sydney style.css, and then i choosed the child theme in the wordpress, till then all was fine

    Thread Starter WebsitesPro

    (@websitespro)

    i removed but now says this:

    Warning: require_once(/home/luissoma/public_html/nuevo/wp-content/themes/sydney-child/widgets/fp-latest-news.php): failed to open stream: No such file or directory in /home/luissoma/public_html/nuevo/wp-content/themes/sydney-child/functions.php on line 9

    Fatal error: require_once(): Failed opening required ‘/home/luissoma/public_html/nuevo/wp-content/themes/sydney-child/widgets/fp-latest-news.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/luissoma/public_html/nuevo/wp-content/themes/sydney-child/functions.php on line 9

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Okay and in your Child Theme functions.php file remove these lines:

    if ( function_exists('siteorigin_panels_activate') ) {
    require_once get_template_directory() . "-child/widgets/fp-latest-news.php";
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can I ask, where did you find these instructions?

    Thread Starter WebsitesPro

    (@websitespro)

    if i remove all the child theme the wordpress it will fixed?

    Thread Starter WebsitesPro

    (@websitespro)

    the support send me that when i asked how to add more entries
    http://athemes.com/forums/forum/sydney/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can just remove those 3 lines and your site will be fixed.

    Thread Starter WebsitesPro

    (@websitespro)

    Right, i remove that lines

    Now the error is

    Parse error: syntax error, unexpected '}' in /home/luissoma/public_html/nuevo/wp-content/themes/sydney-child/functions.php on line 9

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    At least your site will be back online for the theme authors to reply

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Copy all of the code of your functions.php file (child theme) here please

    Thread Starter WebsitesPro

    (@websitespro)

    this is the line 9

    }

    if ( ! function_exists( ‘sydney_setup’ ) ) :
    /**
    * Sets up theme defaults and registers support for various WordPress features.
    *
    * Note that this function is hooked into the after_setup_theme hook, which
    * runs before the init hook. The init hook is too late for some features, such
    * as indicating support for post thumbnails.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry it’s best if we see all of the code in context. As long as it’s not like a thousand lines

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘Error with Child Theme’ is closed to new replies.