• 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 - 31 through 45 (of 61 total)
  • I can’t see the warning anymore, did you deactivate error displaying?
    If not: maybe cache?
    Try it on a different Browser and on a different Device

    Thread Starter jaspervdv

    (@jaspervdv)

    But it may disappear later on. What I dont understand is that I dont see an error when I am logged into wordpress. Trying other browsers does not help. Cache could be the case yeah. I tried to turn off display_errors in my hosting. Maybe I can try this again.

    please do not set display_errors off cause i need to see the errors please set it to on again

    Thread Starter jaspervdv

    (@jaspervdv)

    Alright turned it back on.

    Okay sorry its not cache, I am out of ideas … 🙁
    Can you try activating debug and post the debug log?

    Debugging in WordPress

    • This reply was modified 3 years, 7 months ago by Benedikt Ledl.
    Thread Starter jaspervdv

    (@jaspervdv)

    I used Google, Bing and Safari. I know how to flush my cache through my hosting, if thats what you mean.

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

    (@jaspervdv)

    Maybe I can use a debug plugin to find the debug log?

    hmm maybe but i would try using the wordpress debug mode first

    Thread Starter jaspervdv

    (@jaspervdv)

    I added define(‘WP_DEBUG’, true); to the wp-config.php, but finding the debug.log file is difficult.

    you have to add define(“WP_DEBUG_LOG”, true); too
    the debug file will be generated in /wp-content/debug.log
    if there is no “fatal error” it will not be generated i think
    I just hope that we will get any message in debug log

    • This reply was modified 3 years, 7 months ago by Benedikt Ledl.
    Thread Starter jaspervdv

    (@jaspervdv)

    I just read that and found the log. This is what’s in there:

    [20-Oct-2022 18:14:09 UTC] PHP Notice:  Constant WP_DEBUG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 153
    [20-Oct-2022 18:14:09 UTC] PHP Notice:  Constant WP_DEBUG_LOG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 154
    [20-Oct-2022 18:14:09 UTC] PHP Notice:  Constant WP_DEBUG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 153
    [20-Oct-2022 18:14:09 UTC] PHP Notice:  Constant WP_DEBUG_LOG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 154
    [20-Oct-2022 18:14:26 UTC] PHP Notice:  Constant WP_DEBUG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 153
    [20-Oct-2022 18:14:26 UTC] PHP Notice:  Constant WP_DEBUG_LOG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 154
    [20-Oct-2022 18:15:00 UTC] PHP Notice:  Constant WP_DEBUG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 153
    [20-Oct-2022 18:15:00 UTC] PHP Notice:  Constant WP_DEBUG_LOG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 154
    [20-Oct-2022 18:15:00 UTC] PHP Notice:  Constant WP_DEBUG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 153
    [20-Oct-2022 18:15:00 UTC] PHP Notice:  Constant WP_DEBUG_LOG already defined in /home/customer/www/drone-optiek.nl/public_html/wp-config.php on line 154

    Doesnt look like a clear message.

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

    okay we have now double defined those constants “WP_DEBUG” and “WP_DEBUG_LOG” you have to delete those lines again, sadly this doesn’t get us any further

    for a temporary fix add this to wordpress functions.php:

    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’ );

    }

    Thread Starter jaspervdv

    (@jaspervdv)

    For some reason I can’t. It says: ‘something went wrong’.

    where does this message appear? when changing the file or when opening the site?

Viewing 15 replies - 31 through 45 (of 61 total)

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