Is there a way (a common one) to duplicate and change a theme widget ?
I’m asking this because, I have this widget that displays the recent news and if we click, it will display ALL news, but I wish to create a new widget that lists the latest articles (posts with a category “articles”), and if we click, that lists ALL articles.
Is there any widget like this that someone knows about ? If not, where should I look at in order to duplicate and change a theme widget ?
Thanks a lot
Widgets extend the Widget Class, search in the theme code for a class that
extends WP_Widget
. Copy/Paste it, rename it, and change what you’d like.You can also look in the file
wp-includes/default-widgets.php
and use one of those as a starting point.