WordPress.org

Forums

[resolved] Remove Latest Comments Time, date & Post Title (5 posts)

  1. chanel
    Member
    Posted 6 years ago #

    In my sidebar for my Latest Comments, all I want is the commenter's name and the excerpt. What's being shown is their name, date, time and post title.

    This is what you see now:

    name - 2009-01-08 20:36:13
    post title
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah …

    And this is how I want it to be:

    name
    blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah …

    But I don't know what to take out of this code to achieve that.

    <?php } ?>

    <?php if (is_single() || is_home() || is_page() ) { ?>

    <div class="kutu">
    <div class="ust"><span></span></div><div class="spacer">

    <h2>LATEST COMMENTS</h2>
    <?php global $wpdb, $comments, $comment;

    $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_date, SUBSTRING(comment_content,1,150) AS comment_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 3"); ?>

    <ul id="tab_content_comments" class="tab_content_list1"> <!-- Latest comments -->

    <?php if ( $comments ) : foreach ($comments as $comment) :

    echo '<li class="latestcomment">' . sprintf(__('%1$s <span class="commententrytitle"> - ' .strip_tags($comment->comment_date).

    ''.'
    %2$s</span>
    %4$s …'),

    'comment_post_ID) . '#comment-' . $comment->comment_ID . '" title="' . $comment->comment_author . ' - ' . get_the_title($comment->comment_post_ID) . '"><span class="meta">' . $comment->comment_author . '</span>',

    get_the_title($comment->comment_post_ID),

    get_permalink($comment->comment_post_ID),

    strip_tags($comment->comment_excerpt) ) .'';

    endforeach; endif; ?>

    </div><div class="alt"><span></span></div></div>

  2. chanel
    Member
    Posted 6 years ago #

    ?

  3. chanel
    Member
    Posted 6 years ago #

    I tried removing the lines that calls those commands but it gave my whole site a php error.

    Any able to assist?

  4. chanel
    Member
    Posted 6 years ago #

    still need help with this. sorry for the bumping of the topic. maybe someone who didnt see it before can see it now.

    :)

  5. chanel
    Member
    Posted 6 years ago #

    nevermind. im closing the topic. i ended up using Recent Comments plugin instead.

Topic Closed

This topic has been closed to new replies.

About this Topic