#10612 closed enhancement (wontfix)
Extract recent comments code out of the widget
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Template | Version: | 2.9 |
| Severity: | minor | Keywords: | needs-patch |
| Cc: |
Description
For those of us who don't use a widgetized sidebar, there's no easy way to display recent comments without copy/pasting the widget's code or using a plugin.
The code used in the widget should be extracted into function(s) that can be used outside of the widget.
Change History (5)
comment:3
in reply to:
↑ 1
Viper007Bond — 4 years ago
Replying to azaozz:
Perhaps have a look at the_widget($widget, $instance = array(), $args = array()). It would output an instance of a widget. For recent comments it would be the_widget( 'WP_Widget_Recent_Comments' );.
I had briefly thought about trying to get the widget run on it's own, but then I thought it wouldn't work due to settings, etc.
Good to know (I ended up using a plugin). Thanks!
- Resolution set to wontfix
- Status changed from new to closed
It works pretty well, the settings can be hard-coded or use some code to change them depending on template, etc.
- Milestone Unassigned deleted

Perhaps have a look at the_widget($widget, $instance = array(), $args = array()). It would output an instance of a widget. For recent comments it would be the_widget( 'WP_Widget_Recent_Comments' );.