Home Forums Trusted Trusted PHP Fatal Errors

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12920
    terart gon
    Participant

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function trusted_featured_services(), 0 passed in /home/www/inthelightelectricalllc.com/wp-content/themes/trusted-child/front-page.php on line 12 and exactly 1 expected in /home/www/inthelightelectricalllc.com/wp-content/themes/trusted/functions/extras.php:672
    Stack trace:
    #0 /home/www/inthelightelectricalllc.com/wp-content/themes/trusted-child/front-page.php(12): trusted_featured_services()
    #1 /home/www/inthelightelectricalllc.com/wp-includes/template-loader.php(106): include(‘/home/www/inthe…’)
    #2 /home/www/inthelightelectricalllc.com/wp-blog-header.php(19): require_once(‘/home/www/inthe…’)
    #3 /home/www/inthelightelectricalllc.com/index.php(17): require(‘/home/www/inthe…’)
    #4 {main}
    thrown in /home/www/inthelightelectricalllc.com/wp-content/themes/trusted/functions/extras.php on line 672

    #12927
    Andy
    Keymaster

    It looks like you are using the trusted_featured_services() PHP function in a child theme, to override the functionality of the parent theme.

    When changing/using this function, it requires that exactly 1 parameter (the missing argument in the error) is passed to the function.

    So for example, this will NOT work as there is no parameter:

    trusted_featured_services() {
        /* your custom code */
    }

    This will work and is correct as there is a parameter passed to the function:

    trusted_featured_services(1) {
        /* your custom code */
    }

    The parameter in the working example above “1” refers to the number of the order in which you have set the various homepage sections.

    For example if you have the featured services section in first place before the other homepage sections, use the value “1”, and if it is in position 3, then use the value “3”.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Trusted PHP Fatal Errors’ is closed to new replies.