Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
thanks a lot. I'm just looking at it. ;) –  MEM Jun 19 '11 at 17:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.