diff --git a/simple-custom-post-order.php b/simple-custom-post-order.php index 6b3ebcf..9e3ba59 100644 --- a/simple-custom-post-order.php +++ b/simple-custom-post-order.php @@ -281,8 +281,10 @@ public function refresh() { INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id ) WHERE term_taxonomy.taxonomy = '" . $taxonomy . "' "); - if ($result[0]->cnt == 0 || $result[0]->cnt == $result[0]->max) - continue; + if (count($result) > 0) { + if ($result[0]->cnt == 0 || $result[0]->cnt == $result[0]->max) + continue; + } $results = $wpdb->get_results(" SELECT terms.term_id