Title: WP Courseware Progress Widget SQL Error
Last modified: August 21, 2016

---

# WP Courseware Progress Widget SQL Error

 *  Resolved [mpgps](https://wordpress.org/support/users/mpgps/)
 * (@mpgps)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/wp-courseware-progress-widget-sql-error/)
 * WP Courseware Progress Widget Error (see error below) occurs in Avada Theme when
   theme option “Enable Posts Type Order plugin” is selected.
    Is there a fix?
 * WordPress database error: [You have an error in your SQL syntax; check the manual
   that corresponds to your MySQL server version for the right syntax to use near‘
   LIMIT 0, 1’ at line 1]
    SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.
   ID IN (12097) AND wp_posts.post_type = ‘course_unit’ AND (wp_posts.post_status
   = ‘publish’) ORDER BY wp_posts.menu_order, LIMIT 0, 1
 * [https://wordpress.org/plugins/post-types-order/](https://wordpress.org/plugins/post-types-order/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/wp-courseware-progress-widget-sql-error/#post-4795197)
 * Possible you use an older WordPress version?
    On post-types-order.php line 102
   replace this code
 *     ```
       if ($options['autosort'] == "1")
            $orderBy = "{$wpdb->posts}.menu_order, " . $orderBy;
       ```
   
 * with
 *     ```
       if ($options['autosort'] == "1")
          {
             if(trim($orderBy) == '')
               $orderBy = "{$wpdb->posts}.menu_order ";
               else
               $orderBy = "{$wpdb->posts}.menu_order, " . $orderBy;
   
            }
       ```
   
 * Possible this will make a fix for you, however the Widget query should set an
   order.

Viewing 1 replies (of 1 total)

The topic ‘WP Courseware Progress Widget SQL Error’ is closed to new replies.

 * ![](https://ps.w.org/post-types-order/assets/icon-128x128.png?rev=1226428)
 * [Post Types Order](https://wordpress.org/plugins/post-types-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-types-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-types-order/)
 * [Active Topics](https://wordpress.org/support/plugin/post-types-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-types-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-types-order/reviews/)

## Tags

 * [wp courseware](https://wordpress.org/support/topic-tag/wp-courseware/)

 * 1 reply
 * 2 participants
 * Last reply from: [Maya](https://wordpress.org/support/users/tdgu/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/wp-courseware-progress-widget-sql-error/#post-4795197)
 * Status: resolved