WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. TuomasL
    Member
    Posted 2 years ago #

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

    http://wordpress.org/extend/plugins/latest-news-widget/

  2. cattz
    Member
    Posted 2 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
    Member
    Posted 2 years ago #

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

    'showposts' => 0

    with

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

    Also, not needed to fix this (I think), but as per WP_Query reference in here:
    http://codex.wordpress.org/Class_Reference/WP_Query

    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
    Member
    Posted 2 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
    Member
    Posted 2 years ago #

    Thank you, cattz! This was helpful!

  6. Treebeard
    Member
    Posted 1 year 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?

    thanks!

  7. Treebeard
    Member
    Posted 1 year ago #

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

  8. palmipode
    Member
    Posted 1 year ago #

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

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic