WordPress.org

Ready to get started?Download WordPress

Forums

How to list more than 15 recent posts? (4 posts)

  1. doogie88
    Member
    Posted 4 years ago #

    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.

  2. ClaytonJames
    Member
    Posted 4 years ago #

    /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.

  3. doogie88
    Member
    Posted 4 years ago #

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

  4. ClaytonJames
    Member
    Posted 4 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic