Fatal error when activating child theme

  • abellerby

    #51154

    Hi, I have a website using a DIVI theme which I have imported into a WordPress installation on GoDaddy hosting. The site works as expected when using either the Twenty Seventeen theme or Graphene. Twenty Seventeen also works with a child theme but when I activate a Graphene child them I get errors like:

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 262144 bytes) in /home/jow0mii4q4m8/public_html/wp-includes/class.wp-styles.php on line 315

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 262144 bytes) in /home/jow0mii4q4m8/public_html/wp-includes/class-wp-recovery-mode.php on line 169

    I have tried increasing the memory limit from 256MB to 512MB and instead of the fatal error the website hangs and I eventually get:

    Service Unavailable

    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

    Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

    The admin panel is still available. I have tried disabling/removing all plugins but I still get the same problem.

    Can you help please.

    Admin

    Syahir Hakim

    #51155

    What are the files in your child theme?

    abellerby

    #51156

    I have 2 files – style.css which just has the comment at the top and functions.php which has:
    <?php

    // enqueue styles for child theme
    // @ https://digwp.com/2016/01/include-styles-child-theme/
    function ssas_enqueue_styles() {

    // enqueue parent styles
    // https://codex.wordpress.org/Function_Reference/wp_enqueue_style
    // wp_enqueue_style( $handle, $src, $deps, $ver, $media )
    wp_enqueue_style(‘graphene’, get_template_directory_uri() .’/style.css’);

    // enqueue child styles
    wp_enqueue_style(‘ssasgraphene’, get_stylesheet_directory_uri() .’/style.css’, array(‘graphene’));

    }
    add_action(‘wp_enqueue_scripts’, ‘ssas_enqueue_styles’);

    The same files (with graphene replaced with twentyseventeen) work with the Twenty Seventeen theme.

    Admin

    Syahir Hakim

    #51157

    Can you obtain and share the error log from the hosting? That would help to pinpoint the issue.

    abellerby

    #51158

    The error log I have is 400 lines long – how would you like me to share it?

    Admin

    Syahir Hakim

    #51159

    You may use the contact form here to send us the log: https://www.graphene-theme.com/contact-us/

    Admin

    Syahir Hakim

    #51160

    Thanks for sending that through. Try changing the child theme styles loading to just this:

    wp_enqueue_style( 'graphene-parent', get_template_directory_uri() . '/style.css', array() );
    

    abellerby

    #51161

    Thanks – this is better than it was… I now get the following errors appearing at the top of the webpage:

    Notice: Undefined variable: child_handles in /home/jow0mii4q4m8/public_html/wp-content/themes/graphene/inc/scripts.php on line 254

    Warning: Invalid argument supplied for foreach() in /home/jow0mii4q4m8/public_html/wp-content/themes/graphene/inc/scripts.php on line 254
    Ss Alban & Stephen Catholic Schools’ Federation

    Admin

    Syahir Hakim

    #51162

    You may ignore that notice for now. We’ll include a fix for it in the next theme update.

    To prevent the notice from appearing, try setting WP_DEBUG to false.

    abellerby

    #51163

    Thanks again… I just wanted to check it was OK before setting wp_debug to false.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!