Wordpress Fatal error:

Hello,

After upgrading to Backlight 4.1 I get the following message when going to my Wordpress 5.8.1 blog. https://www.bretculp.com/bret-culp-photography-blog/

Thanks

Fatal error: Uncaught Error: Undefined constant “is_admin” in /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-content/themes/BCP-Wordpress-Pangolin/inc/theme_posts.php:145 Stack trace: #0 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/class-wp-hook.php(305): mod_gallery_image_attributes(Array) #1 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array) #2 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/media.php(1090): apply_filters(‘wp_get_attachme…’, Array, Object(WP_Post), ‘full’) #3 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/post-thumbnail-template.php(179): wp_get_attachment_image(713, ‘full’, false, Array) #4 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/post-thumbnail-template.php(82): get_the_post_thumbnail(Object(WP_Post), ‘full’, Array) #5 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-content/themes/BCP-Wordpress-Pangolin/template-parts/content.php(56): the_post_thumbnail(‘full’, Array) #6 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/template.php(772): require(’/misc/36/328/45…’) #7 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/template.php(716): load_template(’/misc/36/328/45…’, false, Array) #8 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #9 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-content/themes/BCP-Wordpress-Pangolin/loop.php(26): get_template_part(‘template-parts/…’, ‘’) #10 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/template.php(772): require(’/misc/36/328/45…’) #11 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/template.php(716): load_template(’/misc/36/328/45…’, false, Array) #12 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #13 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-content/themes/BCP-Wordpress-Pangolin/index.php(54): get_template_part(‘loop’) #14 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-includes/template-loader.php(106): include(’/misc/36/328/45…’) #15 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-blog-header.php(19): require_once(’/misc/36/328/45…’) #16 /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/index.php(17): require(’/misc/36/328/45…’) #17 {main} thrown in /misc/36/328/452/530/1/user/web/bretculp.com/bret-culp-photography-blog/wp-content/themes/BCP-Wordpress-Pangolin/inc/theme_posts.php on line 145

The problem seems to be when Featured Image on Excerpts is checked. When unchecked I don’t get the Fatal error but I obviously also don’t get the Featured Image.

Any ideas?

No ideas, but I can confirm. On one of my test sites, I had Featured Image on Excerpts enabled and I saw no problem. Then I added a featured image to a post and am now getting this error (not nearly as long as your error):

Warning: Use of undefined constant is_admin - assumed ‘is_admin’ (this will throw an Error in a future version of PHP) in /home1/barbeeph/public_html/backlight-2-100/blog/wp-content/themes/rod-wp/inc/theme_posts.php on line 145

Backlight is up to date. WordPress is up to date. And I did re-export the theme to WordPress after updating Backlight.

On my non-test sites, Backlight is up to date, as is WordPress. I have not re-exported the WordPress themes on those sites and they are not showing the error.

Just created a new installation of WP on another test site. Not seeing the problem there.