Change number of recent posts in Wordpress to more then 15
I just worked on some site where I needed to have more then 15 recent posts listed in wordpress sidebar. However when I changed value in the default wordpress widget it did not worked. After researching little bit I found solution for Wordpress 2.8.
What you need is to do little hack on some wordpress core files. You can see example at above mentioned site.
First go to folder wp-includes of Wordpress. Find file default-widgets.php.
Open it with some editor and find this part of code:
if ( !$number = (int) $instance['number'] )
$number = 10;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;
Its located on line 540 and 541.
Change the “15” at both place to max number of desired latest posts.
After that search for next occurence of “15”. It should be on line 589 with the text
“at most 15”. Change this too to your picked number.
Save the file. Go to widgets, and raise the number of your recent post it should work now.
Notice that after Wordpress upgrade you should do hack again.
No related posts.
[...] to have more then 15 recent posts showed in sidebar. Here is how to do it in Wordpress 2.8. Change number of recent posts in Wordpress to more then 15 | Sulumits Retsambew My idea is that it is better to have link to list of latest 30 posts then 30 tags on frontpage. [...]
Pingback by More then 15 recent posts in Sidebar - Net Builders — July 9, 2009 @ 2:17 pm
Thank you for posting this!
I’m using 2.9.2
To change the number of recent posts, to more than 15, you now have to go to:
default-widgets.php
Comment by SpiderSavvy — March 10, 2010 @ 7:09 pm
Perfect! i was looking all over the web to find the solution! Thank for posting this!
Comment by rasmus — November 12, 2010 @ 9:55 pm