Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m seeing the same error, but I’m not using Codeception.

    Somehow, by the time the tearDownAfterClass() method is called, the connection to the database is closed or otherwise not available.

    I was able to remove the error overriding the tearDownAfterClass() method in the base class for all my tests:

    public static function tearDownAfterClass() {
        global $wpdb;
        @$wpdb->check_connection();
    
        parent::tearDownAfterClass();
    }

    This, of course, is not a great solution, but it works while we discover why is the connection not available at that point.

    You should pass the name, term id (must be an int) or slug of the category, or an array of those values, to has_category().

    If you want to show the go:image tag for the category that has ID = 1, then your code should do the trick. The problem may be associated with the way and place in the code where you are using the value of the $image variable.

    Where is your code being used?
    What template?
    Is it inside the loop?
    Where is the value of the $image variable being used?

Viewing 2 replies - 1 through 2 (of 2 total)