WordPress.org

Ready to get started?Download WordPress

Forums

Top Commentators Widget
How show inside post?! (4 posts)

  1. lordmarcio
    Member
    Posted 2 years ago #

    I want to configure for show inside of a post/page!

    How??? I don't know!!

    http://wordpress.org/extend/plugins/top-commentators-widget/

  2. Lorna Timbah
    Member
    Plugin Author

    Posted 2 years ago #

    Go to Appearance / Widgets, and find in the TCW settings the section called Show in home page only. Set that to No.

  3. lordmarcio
    Member
    Posted 2 years ago #

    I learned | must edit 'function.php' >>

    function top_comment_authors($atts, $content = null) {
        extract(shortcode_atts(array(
            "amount" => '5'
        ), $atts));
        global $wpdb;
        $results = $wpdb->get_results('
            SELECT
            COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url
    
            FROM
            '.$wpdb->comments.'
    
            WHERE
            comment_author_email != "" AND comment_type = "" AND comment_approved = 1
    
            GROUP BY
            comment_author_email
    
            ORDER BY
           comments_count DESC, comment_author ASC
            LIMIT '.$amount
        );
        $screen = "<ul>";
    
        foreach($results as $result){
    
            $screen .= '<li class="top_commentators"><a title="' . $result->comment_author_url . '" href="' . $result->comment_author_url . '" target="_blank" rel="nofollow">' . get_avatar( $result->comment_author_email, $size = '30', '', 'avatar' ) . $result->comment_author . '</a> [' . $result->comments_count . ']</li>';
        }
    
        $screen .= "</ul>";
    
        return $screen;
    }
    
    add_shortcode("top_commentators", "top_comment_authors");

    shortcode = [top_commentators amount=X]

  4. Lorna Timbah
    Member
    Plugin Author

    Posted 2 years ago #

    Those codes are not from the Top Commentators Widget that you linked here. You must be referring to codes similar to this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic