I want to make changes to code of the Recent Posts widget â could anyone please tell me where that code is located?
Thank you in advance!
I want to make changes to code of the Recent Posts widget â could anyone please tell me where that code is located?
Thank you in advance!
You must be logged in to post a comment.
The default Recent Posts Widget code is in
includes/default-widgets.php
but you should not be hacking Core code. Copy that function to your theme’sfunctions.php
, rename it, and create your own customized widget.Have a look in
wp-includesdefault-widgets.php
.If you modify this Widget, be sure to fork it, and register your forked Widget as a new Widget.
Edit
How to fork a core Widget
Start with the Codex entry on the Widgets API.
Rename the Widget
Change this:
…to this:
Modify the Widget class to suit your needs
Register your Widget: