WordPress.org

Support

Support » Plugins and Hacks » How to list more than 15 recent posts?

How to list more than 15 recent posts?

  • Hello
    In my widget it says max recent posts is 15. How can I edit that so I can do more than 15?
    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • /wp-includes/default-widgets.php around line 537

    $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title']);
    if ( !$number = (int) $instance['number'] )
    $number = 10;
    else if ( $number < 1 )
    $number = 1;
    else if ( $number > 15 )
    $number = 15;

    I think if you change 15 to whatever number you need, that might do it. This is a core file, so use caution, make a backup first, and be aware that you will need to re-edit after an upgrade.

    There may be a way to apply a filter to over-ride the settings from a theme file, but I’m afraid that’s a little above my head.

    Thank you! I was searching all the widgets.php and couldn’t find it.

    You’re welcome. Careful with the core files… make a backup just in case!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to list more than 15 recent posts?’ is closed to new replies.
Skip to toolbar