“CRITICAL Object of class WP_Error could not be converted to string” using templates with twig

wp_get_post_terms() returns a WP_Error on failure. (Are you sure it’s $colection and not $collection in that function call?) You can check the return value using is_wp_error() and decide what you’re going to output if it is, in fact, a WP_Error. For example: $term = wp_get_post_terms( $colection->posts[0]->ID ,’look’ ); if ( is_wp_error( $term ) ) { … Read more

Call to undefined function create_function()

create_function was removed in PHP 8.0, so your theme does not appear to be compatible with PHP 8.0+. You have several options to resolve this: If your site is down and it is important to get your site up immediately, ask your host to downgrade PHP to 7.4. Just be aware that security support for … Read more