PHP Warning: Declaration of Bootstrap_Walker_Nav_Menu::start_lvl
This support request was posted in Smart by graphicz
- graphicz January 12, 2021 at 9:13 am
Using the search box gives error: There has been a critical error on this website
Error log shows: PHP Warning: Declaration of Bootstrap_Walker_Nav_Menu::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL) in /home/grapcouk/public_html/blog/wp-content/themes/smartwp/functions/function-extras.php on line 51
I changed function-extras.php like this:
// function start_lvl( &$output, $depth ) {
function start_lvl(&$output, $depth = 0, $args = NULL) {Search still shows error.
Log now shows:
[12-Jan-2021 08:59:06 UTC] PHP Parse error: syntax error, unexpected ‘new’ (T_NEW) in /home/grapcouk/public_html/blog/wp-content/themes/smartwp/search.php on line 25
[12-Jan-2021 09:01:26 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘load_dashicons’ not found or invalid function name in /home/grapcouk/public_html/blog/wp-includes/class-wp-hook.php on line 287
Please can you advise? Thank you.
graphicz January 12, 2021 at 7:48 pmFor anyone else it is a php 7 thing.
Find functions.php or functions-extras.php and ensure this is at the bottom:
function ww_load_dashicons(){ wp_enqueue_style('dashicons'); } add_action('wp_enqueue_scripts', 'ww_load_dashicons', 999);
in search php change
$allsearch = & new WP_Query
to$allsearch = new WP_Query
Juanfra Aldasoro January 13, 2021 at 10:47 amHi,
Thank you for reaching out to us, I hope you had a good start of 2021!
And thank you for reporting this. We’ll be following your finding regarding PHP7 compatibility and updating accordingly.
Best,
Juan.
You must be logged in to reply to this topic.