• Resolved jaspervdv

    (@jaspervdv)


    Hello,

    I got the following warning when I visit my home page on mobile: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘child_enqueue_styles’ not found or invalid function name in /home/customer/www/drone-optiek.nl/public_html/wp-includes/class-wp-hook.php on line 307.

    I have no experience with the theme editor and I don’t use it. Still this error appeared. I recently re-installed the Astra Child Theme and updated some plugins. I deactivated all the plugins but that did nothing.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 46 through 60 (of 61 total)
  • Thread Starter jaspervdv

    (@jaspervdv)

    In the theme editor. It is working now after I removed this:

    function child_enqueue_styles() {

    wp_enqueue_style( ‘astra-child-theme-css’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘astra-theme-css’), CHILD_THEME_ASTRA_CHILD_VERSION, ‘all’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘child_enqueue_styles’, 15 );

    is the error now gone?

    Thread Starter jaspervdv

    (@jaspervdv)

    No its still there.

    sorry i’m out of ideas if you set display_errors to off again users won’t see it, the problem will remain unsolved tho..

    Thread Starter jaspervdv

    (@jaspervdv)

    When I set display_errors on off, even then the error appears. I think thats just a matter of time, right? The weird thing about it is the fact that it only shows on the hoepage on mobile, nowhere else. So I dont exactly now when this problem occured.

    no this shouldn’t be a matter of time
    i am going to keep searching a bit I will write in a few minutes if I found something or not

    can you try deactivating elementor? tell me if the error is still there when its deactivated

    Thread Starter jaspervdv

    (@jaspervdv)

    No, but I mean when users won’t see it because of the display_errors on ‘off’. I will keep it on for now if that helps.

    Thread Starter jaspervdv

    (@jaspervdv)

    I deactivated both Elementer and Elementor Pro. Error is still there. I deactivated all the plugins yesterday but that didn’t help either.

    • This reply was modified 3 years, 7 months ago by jaspervdv.

    we have to find where the add_filter(“some_hook”, “child_enqueue_styles”…..) is

    Thread Starter jaspervdv

    (@jaspervdv)

    When I use the search option in my file manager from Siteground (my webhost) and search for ”add_filter” I get no results.

    the search option is your file manager probably only searches for file names

    I’m sorry I am out of ideas and I can’t find anything

    Thread Starter jaspervdv

    (@jaspervdv)

    That’s no problem. Thank you very much for helping. I learned a lot more about the file manager and I know where to look for. Got some new errors in the debug.log though.

    [20-Oct-2022 18:22:42 UTC] PHP Fatal error:  Cannot redeclare child_enqueue_styles() (previously declared in /home/customer/www/drone-optiek.nl/public_html/wp-content/themes/astra-child/functions.php:21) in /home/customer/www/drone-optiek.nl/public_html/wp-content/themes/astra/functions.php on line 180
    [20-Oct-2022 18:23:09 UTC] PHP Fatal error:  Cannot redeclare child_enqueue_styles() (previously declared in /home/customer/www/drone-optiek.nl/public_html/wp-content/themes/astra-child/functions.php:21) in /home/customer/www/drone-optiek.nl/public_html/wp-content/themes/astra-child/functions.php on line 25
    [20-Oct-2022 18:45:27 UTC] PHP Deprecated:  Function get_magic_quotes_gpc() is deprecated in /home/customer/www/drone-optiek.nl/public_html/wp-content/plugins/advisor-quiz/admin/qedux-framework/inc/classes/class.qedux_ajax_save.php on line 51
    • This reply was modified 3 years, 7 months ago by jaspervdv.

    new errors are always good xD those first two are just the code that i told you to add i nthe functions.php as a “temporary fix” πŸ˜€ you can delete that again
    I will see if I can find something tomorrow πŸ™‚

Viewing 15 replies - 46 through 60 (of 61 total)

The topic ‘warning: call_user_func_array() expects parameter 1 to be a valid callback, func’ is closed to new replies.