0

when i try to activate Yoast Seo Plugin, my WordPress panel stop loading and the browser displays: HTTP ERROR 500.
I checked my error_log file and there was this error:

call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_generate_theme_initialize' not found or invalid function name in .../wp-includes/class-wp-hook.php on line 286

which the line 286 is:

if ( $the_['accepted_args'] == 0 ) {
                $value = call_user_func_array( $the_['function'], array() );
            } elseif ( $the_['accepted_args'] >= $num_args ) {
                $value = call_user_func_array($the_['function'], $args ); //Line 286
            } else {
                $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
            }

I don't it's related to my problem or not cause the time of the error was right but when I delete the error_log file and refresh my WordPress panel the error_log file didn't show any errors...

In case you need my function.php, here is 20 first lines of my code:

<?php
add_action('wordpress_theme_initialize', 'wp_generate_theme_initialize');
// function wp_generate_theme_initialize(  ) {
    //   echo "Designed by Mehdi Karimi";
// }
add_action('after_setup_theme', 'setup_theme_after_run', 999);
function setup_theme_after_run() {
    if(has_action( 'wordpress_theme_initialize',  'wp_generate_theme_initialize')) {
        add_action('wordpress_theme_initialize', 'wp_generate_theme_initialize');
    }
}
add_action('wp_footer', 'setup_theme_after_run_footer', 1);
function setup_theme_after_run_footer() {
   if(did_action('wordpress_theme_initialize' )) {
       add_action('wp_footer', 'wp_generate_theme_initialize');
   }
}

Here is my website: MegaTips Thanks for your time... ♥

  • 1
    The problem is your function.php. You have commented out the function wp_generate_theme_initialize but are still calling it in the first line. So either remove/comment that line or do not uncomment the function. This is also what the error says: function 'wp_generate_theme_initialize' not found – kraftner Nov 9 '18 at 13:47
  • 1
    That would be responsible for the error in the error log, but wouldn't throw a 500 error and break the site. If a relatively popular plugin like Yoast is causing this error, then there's either a conflict with another plugin, or you're running an out of date version of PHP. – Jacob Peattie Nov 9 '18 at 13:55
  • @kraftner ok i uncomment that but still the my panel not loading after activating yoast – Milad M Nov 9 '18 at 13:57
  • @JacobPeattie yes I guess yoast got conflict with W3 Total Cache, cause when I deactivate W3, my panel loads fine with yoast working fine... – Milad M Nov 9 '18 at 13:59
  • @JacobPeattie and by the way when yoast is activated and w3 deactivated, my panel loads but the theme customizer won't load... – Milad M Nov 9 '18 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.