WordPress.org

Ready to get started?Download WordPress

Forums

Recent Comments Problem (8 posts)

  1. jafer
    Member
    Posted 9 years ago #

    Now that I'm using 1.2, the recent comments plugin is not working properly. It shows the most recent comments alright, but if you click on the comment, it will just take you to the trackback page, but not show the comment.

    The only way to see the comments are to click on the popup comment link and then you can see everyone's comment.

    Is there a way for me to fix this? I'm also using the plugger plugin with it. Is that the problem (although they both worked fine together before).

    Thanks very much.

  2. jafer
    Member
    Posted 9 years ago #

    Anyone?

  3. jafer
    Member
    Posted 9 years ago #

    Maybe I haven't been clear with this, since no one's offered any solutions.

    My comments will show if you click on the popup comments (as if you were going to post).

    However, in the "recent comments" (my-hack.php), where it shows the most recent 5 comments text, if you click on the actual text of the comments, it takes you to the trackback page, e.g., http://www.idiotonastick.com/wp/index.php?p=18#comment-40

    But on that page, you don't see any comments at all... just that post. And where you should see their comments, it just has the links to the sites of those who commented.

    Is that more understandable? I know that there was a problem before with comments, where someone gave me the tracking to posts here, but I haven't seen anything addressing this.

  4. That's because you're using popup comments. You hack is set to link show the recent comments, then link to each post. You, however, are not using in-post comments. You are using popup comments. Alter your hack so that it links to the popup comments page for each post, or turn off popup comments.

  5. jafer
    Member
    Posted 9 years ago #

    Thanks macmanx, but I don't know how to do that. Do I alter the my-hacks file? And, if so, what do I change it to?

    When I used this plugin in the older version, it would pull up the regular comment page when you clicked on their comments, but you could also see it in the popup comments.

    What should I change? I'm all ears (with no php knowledge between them).

  6. I don't know how to did your hack. But, you want to change the links from going to the index.php version of the comments to the wp-comments-popup.php version.

  7. jafer
    Member
    Posted 9 years ago #

    This is what's in my-hacks (as found in the wiki). And then on my page I just add the get_recent_comments code as per MtDewVirus page.

    Is there something within this that I should change?

    code'<?php
    function get_recent_comments($no_comments = 5, $comment_lenth = 5, $before = '

    <li>', $after = '</li>
    ', $show_pass_post = false) {
    global $wpdb, $tablecomments, $tableposts;
    $request = "SELECT ID, comment_ID, comment_content, comment_author FROM $tableposts, $tablecomments WHERE $tableposts.ID=$tablecomments.comment_post_ID AND post_status = 'publish' ";
    if(!$show_pass_post) { $request .= "AND post_password ='' "; }
    $request .= "AND comment_approved = '1' ORDER BY $tablecomments.comment_date DESC LIMIT $no_comments";
    $comments = $wpdb->get_results($request);
    $output = '';
    foreach ($comments as $comment) {
    $comment_author = stripslashes($comment->comment_author);
    $comment_content = strip_tags($comment->comment_content);
    $comment_content = stripslashes($comment_content);
    $words=split(" ",$comment_content);
    $comment_excerpt = join(" ",array_slice($words,0,$comment_lenth));
    $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
    $output .= $before . '<strong>' . $comment_author . ':</strong> <a href="' . $permalink;
    $output .= '" title="View the entire comment by ' . $comment_author.'">' . $comment_excerpt . '...</a>' . $after;
    }
    echo $output;
    }
    'code

    Thanks for your input.

  8. jafer
    Member
    Posted 9 years ago #

    Ok, now that I have a partial answer, does anyone know the rest of it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.