WordPress.org

Support

Support » Plugins and Hacks » Network Latest Posts » [Resolved] Widget cause error

[Resolved] Widget cause error

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jose Luis SAYAGO

    @iluminatus

    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/ there’s the last version (3.5) working without problems.

    Maybe it’s another plugin causing incompatibility issues?

    ThorHammer

    @thorhammer

    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

    @iluminatus

    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?

    ThorHammer

    @thorhammer

    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

    @iluminatus

    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.

    ThorHammer

    @thorhammer

    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

    @iluminatus

    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 ‘[Resolved] Widget cause error’ is closed to new replies.
Skip to toolbar