Divi Theme: Object of class WP_Post could not be converted to string

Table of Contents
    square-for-kb1
    Divi-issue

    Issue

    If you’re using a Divi website and randomly experience an issue such as “There has been a critical error on this website”, there’s a high chance that the et_divi option is corrupted.

    Below is a quick solution to fix it

    Investigation

    Follow the prompts below:

    1. Firstly, go into the Staq Panel for the site in question and click Debug.
    2. Then, Enable Debug.
    3. Then, click WordPress tab
    4. Go back to the WordPress site > Appearance > Themes and try to generate the error message. You will either generate the error message by clicking Themes  or by activating Divi
    5. Go back to Staq Panel and click Refresh under the WordPress logs tab

    If you see this same issue, then the solution below will assist:

    In summary, the issue is this Uncaught Error: Object of class staClass could not be converted to string

    Solution

    Go to the Plugins list and install Code Snippets.

    Then, open the plugin and create a snippet and paste this code:

    $empty = array();

    update_option(‘et_divi’, $empty);

    Make sure you Save Changes and Activate the snippet:

    Clear Divi Cache

    Soon after, clear the Divi cache if static CSS has been applied by going to Divi > Builder > Advanced and click Clear if Static CSS File Generation is Enabled:

    After that, confirm if the Divi theme loads.

    Try Staq
    Everything WordPress in one place. Simplify WordPress, streamline your flow
    square-for-kb3