Title: bug and solution
Last modified: October 24, 2022

---

# bug and solution

 *  [guiver01](https://wordpress.org/support/users/guiver01/)
 * (@guiver01)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/bug-and-solution/)
 * Hello,
    First, sorry for my English.
 * This plugin cause a bug with all widgets who list the last blog of the category
   sorted by oldest.
 * here : function poc_category_order( $query )
    We have : `if ( $post_order == '
   oldest' && $query->is_category($cat_id) && $query->is_main_query() )` This conditionnal
   test ” && $query->is_category($cat_id)” is useless and cause the bug. I change
   it to : `if ( $post_order == 'oldest' && $query->is_main_query() )`
 * And all is working.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Atanas Yonkov](https://wordpress.org/support/users/nravota12/)
 * (@nravota12)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/bug-and-solution/#post-16198168)
 * Hi [@guiver01](https://wordpress.org/support/users/guiver01/) ,
    I think there
   should be a reason I added this extra check `$query->is_category($cat_id)` but
   I do not remember on prima vista. I will test and let you know. What widget causes
   a problem?

Viewing 1 replies (of 1 total)

The topic ‘bug and solution’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-order-by-category.svg)
 * [Post Order By Category](https://wordpress.org/plugins/post-order-by-category/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-order-by-category/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-order-by-category/)
 * [Active Topics](https://wordpress.org/support/plugin/post-order-by-category/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-order-by-category/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-order-by-category/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Atanas Yonkov](https://wordpress.org/support/users/nravota12/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/bug-and-solution/#post-16198168)
 * Status: not resolved