Articles of wp list comments

Where are comments coded when using custom theme?

I am having issues displaying both the default comment system and a plugin comment system in WordPress. Comments are enabled via WordPress settings, comments are being made somehow via spam bots, but comments are not being displayed on posts or pages even though they are enabled per post and page as well. I tried looking […]

Custom comment link

How can I customize my comment link without modifying comment-template.php file line 676: $link = $link . ‘#comment-‘ . $comment->comment_ID; I would like to get the same link just little modified and it should look like: $link = $link . ‘?comments#comment-‘ . $comment->comment_ID; And I’m using my comments to show like this: $page = intval( […]

Same comments on all posts

I am working on a self-made theme and I have an issue where all of the comments are showing up on all the posts, instead of each post only showing their own comments. I am using this code to display comments: <?php if (have_posts()): ?> <?php while (have_posts()): ?> <?php the_post(); ?> // The title, […]

How to get comments other than using wp_list_comments?

I’m sure you guys are wondering, “why the hell?” – basically it is because it does not work with a plugin by NextSCRIPTS that pulls comments from facebook. When I’m in the admin panel I see the comments properly, but on the blog posts it just keeps showing the admin instead of the users. This […]

Make user's name display as the site name in comments if it matches certain roles

So here’s what I’m trying to do. I’m working on a plugin and I want to check each comment and see if the author of that comment has a role of “administrator” or “editor”. If they do, rather than display their user name and avatar, I would like to display the name of the website […]

Remove the function which adds nofollow to links in comments

Not sure where the function is that does this but i need to remove it so all links in comments do not contain the rel=”nofollow” attribute. I know i can use the comment_text filter to remove nofollow but thats not what i need to do. What i need to do is remove the function from […]

show list of latest comments for each post in a loop

I want to show the last 5 comments for each post on my index page loop of posts. What Im using now is only showing the same comments for every post. How should I set this up and how can I add an avatar to each comment. What have this obviously isn’t working.. <?php $args […]

How to output comments number of a post per day?

I have a question about the comment numbers in a post… For now, I can output the total number of a comment inside a post outside the loop. That’s cool enough, but I want to get show the comment number/amount of a post PER DAY. So let’s say I have a post and people are […]

wp_list_comments renders incorrectly nested <ul>

I’m trying to figure out how wp_list_comments works. So I made the simplest possible callback just to see the structure of the result: function custom_comments_callback( $comment, $args, $depth ) { $GLOBALS[‘comment’] = $comment; ?> <li <?php comment_class(); ?> id=”li-comment-<?php comment_ID(); ?>”> Hello! </li> <?php } I thought this function would be structurally correct but the […]

Customizing Comments on Posts

I have implemented custom code for generating comments on post page using callback function in functions.php. function MYTHEME_comment($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; ?> <li <?php comment_class(); ?> id=”li-comment-<?php comment_ID() ?>”> <div class=”comment-author vcard”> <?php echo get_avatar($comment,$size=’48’ ); ?> <div class=”comment-meta”><a href=”<?php the_author_meta( ‘user_url’); ?>”><?php printf(__(‘%s’), get_comment_author_link()) ?></a></div> </div> <div class=”clear”></div> <?php if ($comment->comment_approved […]