WordPress.org

Forums

Network Latest Posts
[resolved] Widget cause error (8 posts)

  1. ThorHammer
    Member
    Posted 2 years ago #

    The widget gives nothing but an error.

    http://wordpress.org/extend/plugins/network-latest-posts/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  3. ThorHammer
    Member
    Posted 2 years ago #

    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

  4. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 2 years ago #

    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?

  5. ThorHammer
    Member
    Posted 2 years ago #

    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.

  6. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  7. ThorHammer
    Member
    Posted 2 years ago #

    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 :-)

  8. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Network Latest Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.