Title: Widget cause error
Last modified: August 20, 2016

---

# Widget cause error

 *  Resolved [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/)
 * The widget gives nothing but an error.
 * [http://wordpress.org/extend/plugins/network-latest-posts/](http://wordpress.org/extend/plugins/network-latest-posts/)

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

 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202536)
 * Hi,
 * Could you please provide more information about the error? What kind of message
   are you getting?
 * If you check my test lab: [http://testlab.8elite.com/posts/](http://testlab.8elite.com/posts/)
   there’s the last version (3.5) working without problems.
 * Maybe it’s another plugin causing incompatibility issues?
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202537)
 * Sure, here is the output in the widget:
 * **Warning: krsort() expects parameter 1 to be array, null given in /home/litterqf/
   public_html/wp-content/plugins/network-latest-posts/network-latest-posts.php 
   on line 479**
 * Warning: array_slice() expects parameter 1 to be array, null given in /home/litterqf/
   public_html/wp-content/plugins/network-latest-posts/network-latest-posts.php 
   on line 482
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202538)
 * I see, well that’s because Network Latest Posts is trying to sort an empty array,
   I will add a catch for that warning.
 * Basically it means you’re trying to sort an empty output, in short, no posts 
   were found matching your widget parameters. Could you please create a test page
   with a shortcode using the same parameters your widget is using and check what’s
   the result?
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202539)
 * Ah … ops. I tried to ask for posts from two categories (IDs), but when I removed
   these, the output came … Strange, since this is the only two categories with 
   content.
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202540)
 * Hi, well if you want to use categories, you must use their slugs for example 
   if your category is “Fast Cars” then you set fast-cars in the Category(ies) field.
   If there are multiple categories then you separate them by commas, for example:
   my-category1, my-category2.
 * I’m adding a catch for those warnings, it will display “Sorry, I couldn’t find
   any recent posts matching your parameters” that way you’ll know if there’s something
   wrong. I’ll be pushing the new version in a minute.
 *  Thread Starter [ThorHammer](https://wordpress.org/support/users/thorhammer/)
 * (@thorhammer)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202541)
 * I was in the template world and wrote category IDs like this: 1,3,4….
 * So, sorry, I made a mistake. It works like a charm 🙂
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202542)
 * Great!, yes it happens, early versions of NLPosts were using category IDs but
   it was really painful for non-geeks to easily spot category IDs so I replaced
   them by their slugs which are more user-friendly.
 * Good to know everything works as expected now, cheers.

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

The topic ‘Widget cause error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/network-latest-posts_61c601.svg)
 * [Network Latest Posts](https://wordpress.org/plugins/network-latest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/network-latest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/network-latest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/network-latest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/network-latest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/network-latest-posts/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/widget-cause-error/#post-3202542)
 * Status: resolved