Home Forums Community Forum Need help with old child theme header.php and Fatal error causing – See below

Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • pyramidmdt
    Participant
    Post count: 1

    Hello
    I have just worked through getting avada updated on an antiquated site running a child theme I am recieving this error when I preview the child –

    Fatal error: Uncaught Error: Call to undefined method Avada::c_pageID() in /home/atlan725/public_html/wp-content/themes/Avada-Child-Theme/header.php:55 Stack trace: #0 /home/atlan725/public_html/wp-includes/template.php(688): require_once() #1 /home/atlan725/public_html/wp-includes/template.php(647): load_template(‘/home/atlan725/…’, true) #2 /home/atlan725/public_html/wp-includes/general-template.php(41): locate_template(Array, true) #3 /home/atlan725/public_html/wp-content/themes/Avada/100-width.php(15): get_header() #4 /home/atlan725/public_html/wp-includes/template-loader.php(74): include(‘/home/atlan725/…’) #5 /home/atlan725/public_html/wp-blog-header.php(19): require_once(‘/home/atlan725/…’) #6 /home/atlan725/public_html/index.php(17): require(‘/home/atlan725/…’) #7 {main} thrown in /home/atlan725/public_html/wp-content/themes/Avada-Child-Theme/header.php on line 55

    This is line 46 to 73 below

    $viewport = apply_filters( ‘avada_viewport_meta’, $viewport );
    echo $viewport;
    ?>

    <?php wp_head(); ?>

    <?php

    $object_id = get_queried_object_id();
    $c_pageID = Avada::c_pageID();
    ?>

    <!–[if lte IE 8]>
    <script type=”text/javascript”>
    jQuery(document).ready(function() {
    var imgs, i, w;
    var imgs = document.getElementsByTagName( ‘img’ );
    for( i = 0; i < imgs.length; i++ ) {
    w = imgs[i].getAttribute( ‘width’ );
    imgs[i].removeAttribute( ‘width’ );
    imgs[i].removeAttribute( ‘height’ );
    }
    });
    </script>

    <script src=”<?php echo get_template_directory_uri(); ?>/assets/js/excanvas.js”></script>

    <![endif]–>

    Any idea what I can edit to get this child theme to work?
    Not the greatest at php so thanks in advance.

    Thor Torgersen

    Michael C
    Keymaster
    Post count: 437

    Hi @pyramidmdt,

    Particularly with template overrides, these should be updated whenever you update the parent theme. For example, the fatal error here will be due to changes in the parent theme header.php. So what was valid in the previous version is no longer valid. Essentially the child theme is loading an outdated file.

    So to resolve that you can copy and paste the header.php from the parent to child theme. Then re-add whatever customization you had made.

Viewing 2 posts - 1 through 2 (of 2 total)
Only users with a registered purchase of Avada can post to the community forum. Please register your purchase here.