create widget to display comments in wordpress
'bb_comments_Widget', 'description' => __('A widget that displays comments', 'bb_comments_Widget') );
/* Widget control settings. */
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'bb_comments_Widget' );
/* Create the widget. */
$this->WP_Widget( 'bb_comments_Widget', __('GS bookshowcase reviews', 'bb_comments_Widget'), $widget_ops, $control_ops );
}
/**
* How to display the widget on the screen.
*/
function widget( $args, $instance ) {
extract( $args );
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title'] );
$number = $instance['number'];
/* Before widget (defined by themes). */
echo $before_widget;
/* Display the widget title if one was input (before and after defined by themes). */
if ( $title )
echo '
|
comment_content); ?>