• I am currently running 2.1.1 using the Recent Comments Widget. Under my current site, I use a page for discussion among different people. Therefore, I am found commenting on my own posts.

    However, when I comment on my own posts it displays that on the Recent Comments widget, displayed on my sidebar.

    Is it possible to add a switch that will exclude personal comments so that only non-admin comments are displayed on the widget?

    Right now I am looking at widget/widget.php:

    <?php
    }
    
    function widget_recent_comments_control() {
    	$options = $newoptions = get_option('widget_recent_comments');
    	if ( $_POST["recent-comments-submit"] ) {
    		$newoptions['title'] = strip_tags(stripslashes($_POST["recent-comments-title"]));
    	}
    	if ( $options != $newoptions ) {
    		$options = $newoptions;
    		update_option('widget_recent_comments', $options);
    	}
    	$title = htmlspecialchars($options['title'], ENT_QUOTES);
    ?>
    			<p><label for="recent-comments-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="recent-comments-title" name="recent-comments-title" type="text" value="<?php echo $title; ?>" /></label></p>
    			<input type="hidden" id="recent-comments-submit" name="recent-comments-submit" value="1" />
    <?php

    Would I change something here?

Viewing 1 replies (of 1 total)
  • spiritofburning, try the GetRecentComments widget which you can get here. It has a lot of great options, including the ability to exclude Blog author comments.

Viewing 1 replies (of 1 total)

The topic ‘Customizing Recent Comments Widget’ is closed to new replies.