Latest News Widget
Number of posts doesn't work (8 posts)

  1. TuomasL
    Posted 4 years ago #

    Plugin works ok otherwise, but limiting the number of posts does not work.


  2. cattz
    Posted 4 years ago #

    I've noticed that issue as well. The offset parameter works fine, but not the limit. No matter what you put in there, the query is always built with a limit of 10 posts.

    Have you managed to sort this out?

  3. cattz
    Posted 4 years ago #

    I think I found it myself: In the file class.widget.php line 46, replace

    'showposts' => 0


    'showposts' => $instance['posts_num']

    Also, not needed to fix this (I think), but as per WP_Query reference in here:

    showposts is deprecated and should be replaced by posts_per_page.
    There is another ocurrence of showposts a few lines up.

    I hope you find this helpful!!!

  4. TuomasL
    Posted 4 years ago #

    Thanks for the input cattz, however as quite likely I switched to another alternative. :) Then again, 5 months forward, i.e. now, I'd just do this by a simple query directly in my theme header. As at least for me this kind of function is something that is designed into the layout, and it most likely would never change. :)

  5. razrabotchik_www
    Posted 4 years ago #

    Thank you, cattz! This was helpful!

  6. Treebeard
    Posted 3 years ago #

    Has this been fixed yet? I'm still having this issue, no matter what I put in there, it's showing as many posts as are in the test site (we have less than 10 now, so I don't know how many will eventually show up).

    I don't want to bother editing the plugin files (obviously would be lost with the next update) so is this going to be fixed? Or should I go find another plugin maybe?


  7. Treebeard
    Posted 3 years ago #

    never mind, I found another one that works: Category Posts widget.

  8. palmipode
    Posted 3 years ago #

    thans you so much Cattz for this tip it works hard for me ;)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Latest News Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic