Forum Replies Created

Viewing 1 replies (of 1 total)
  • Jani

    (@janiprog001)

    Hi Jules,

    Late reply but the warnings on lines 156-157 of class-virtue-get-image.php are a PHP 8 strictness thing, not a “broken theme” thing exactly.

    wp_get_attachment_image_src() returns false when the attachment can’t be resolved (deleted image, missing thumbnail size, broken meta). Up to PHP 7, subscripting a bool ($image[0]) silently returned null. PHP 8 made that into a warning, so Virtue’s existing code is fine until it isn’t — the moment one image goes missing, the log fills up.

    This is also why downgrading to 8.1 made the site usable: the access still fails the same way, PHP 8.1 just doesn’t surface it as loudly.

    A child theme override of class-virtue-get-image.php with a guard around line 156 is the smallest fix:

    $image = wp_get_attachment_image_src( $id, $size );
    if ( ! is_array( $image ) ) { $image = [ '', 0, 0, false ]; }

    The white-page outcome from Bluehost’s earlier wp-config suggestion probably means something else hit a fatal in that path with debug on — try just WP_DEBUG_LOG = true and leave WP_DEBUG_DISPLAY false. Logs still capture, no on-page output.

    Kadence’s suggestion to switch to a current theme is the long-term right answer, but the two-line guard above will quiet the log today.

Viewing 1 replies (of 1 total)