Roots Discourse

ErrorException /index.php http response code 500

For the last week, I’ve been having some issues by getting 502 bad gateway and 503 Service Unavailable errors. This is the error message that gets logged:

### Error message
**ErrorException** : Uncaught exception 'ErrorException' with message 'Cannot use object of type WP_Post as array (View: /nas/content/live/site/wp-content/themes/sitetheme/resources/views/partials/archive/hero.blade.php) (View: /nas/content/live/site/wp-content/themes/sitetheme/resources/views/partials/archive/hero.blade.php)' in /nas/content/live/site/wp-content/uploads/cache/e7640697ec0b1377f82399e8d5021d054ff04c2f.php:76

and this is what i have on line 76:
@if ($post_type !== ‘customer_story’ && $excerpt = get_the_excerpt($post[‘post’]->ID))

any suggestions would be greatly appreciated.

Apparently $post is already a WP_Post object, hence it can’t be accessed like an array.
Is that line from original sage theme? And are you modifying the $post somehow?

Thank you, this solved my issue.

This topic was automatically closed after 42 days. New replies are no longer allowed.