how to make Emil Olssons hi-response/hi-response-full/hi-response-single WordPress Theme php 7.2 compatible
Replace eregi with preg_match in:
snippets/image-grab-src.php
1 2 3 4 5 6 7 8 9 |
<?php // Grab image, if .gif, always use full size to make sure it displays correctly $image = wp_get_attachment_image_src($attachment_id); // old if (eregi('.gif', $image[0])) {$size = "full";} if (preg_match('/.gif/i', $image[0])) { $size = "full"; } $image = wp_get_attachment_image_src($attachment_id, $size); ?> |
snippets/image-grab-hover-src.php
1 2 3 4 5 6 7 8 9 |
<?php // Grab image, if .gif, always use full size to make sure it displays correctly $image_hover = wp_get_attachment_image_src($attachment_id_2); // old if (eregi('.gif', $image_hover[0])) {$size = "full";} if (preg_match('/.gif/i', $image_hover[0])) { $size = "full"; } $image_hover = wp_get_attachment_image_src($attachment_id_2, $size); ?> |
Thank you very much ! That saved me a lot of time !
Kommentar by Pascal — 3. November 2018 @ 09:55
Hi –
We have a website based on Hi-Response.
It works fine with PHP 5.6, but this is becoming obsolete with our host – they upgraded automatically to 7.2 and our website crashed.
We get the following errors, among others:
Warning: Declaration of Walker_Nav_Menu_Dropdown::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /customers/3/c/6/llarchitects.co.uk/httpd.www/wp-content/themes/hi-response-full/functions.php on line 506
Warning: Declaration of Walker_Nav_Menu_Dropdown::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = Array) in /customers/3/c/6/llarchitects.co.uk/httpd.www/wp-content/themes/hi-response-full/functions.php on line 506
Warning: Declaration of Walker_Nav_Menu_Dropdown::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /customers/3/c/6/llarchitects.co.uk/httpd.www/wp-content/themes/hi-response-full/functions.php on line 506
Warning: Declaration of Walker_Nav_Menu_Dropdown::end_el(&$output, $item, $depth) should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = Array) in /customers/3/c/6/llarchitects.co.uk/httpd.www/wp-content/themes/hi-response-full/functions.php on line 506
I tried your changes but didn’t manage to get our website back – wondering if you might be able to offer any suggestions?
Kommentar by Andrew Llowarch — 17. November 2018 @ 19:47
Sorry, I can’t help you, but I see that you fixed it somehow. Your site is currently up and running.
Kommentar by Fabian Thommen — 25. Februar 2019 @ 11:03
Hi Fabien
Just checking re the code above – is that the only changes you need to make to the Hi_Response theme code to make it compatible for PHP 7.2?
Any advice on this would be greatly appreciated
Thanks david
Kommentar by David Watson — 27. November 2020 @ 17:34
It’s all we had to change. But if you use the Theme differently, you might need to change other things as well.
Kommentar by Roman Abt — 3. Februar 2021 @ 07:58