comment_author
prints the author. It doesn’t return anything.
So if you do this:
if ( $comment->comment_parent )
comment_author( $comment->comment_parent ) . ', ';
Then, what it really does is:
- check if comment has parent and if so:
- print its author
- get the result of function
comment_author
(which is empty) and concatenate it with string containing ‘, ‘ - don’t do anything with that string
And what you want is this:
if ( $comment->comment_parent ) {
comment_author( $comment->comment_parent );
echo ', ';
}
Related Posts:
- Is it possible to pull comments from facebook into your blog?
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- How to use a custom comments template
- Comment visibility
- Get comments for more than one post
- Add placeholder attribute to comment form fields
- Allowing more elements in comments via functions.php
- Set post comments open function
- “Categories” for comments?
- Allow anonymous comments, but prevent spam [closed]
- Where to remove from comment’s feed?
- Allow guests comments on single post
- Delete all user comments
- Why do I get email notifications about comments that WordPress has already determined are spam?
- Delayed commenting
- “Leave a comment” link even when you can’t
- An action hook where a comment meta is updated
- Display number of comment replies
- User can post only one comment per day on one page
- Last comment page first with full number of comments?
- Only subscriber role user can comment not other
- customize comment form
- How to check if commenter is the_author?
- Relaxing unescaped HTML filtering inside tags?
- WordPress comments email notification for authors
- How to get the result of comments_number() as a string instead of printing it out?
- Should I still worry about paginated comments with the latest wordpress versions?
- How to dont allow registered users to comment without being logged in?
- edit comments capability for authors
- Publish a message on facebook after having posted a comment
- Users with custom roles can’t read each other’s comments
- Why is_wp_error() is not returning false even there’s no defined error
- wp_insert_comment and security
- How can someone submit a comment when my site has no comment field?
- Separete trackbacks/pings and numbered comments
- How can I fix wp_insert_comment failure when ‘comment_content” includes slanted apostrophe in Excel csv source data
- Show comments in a popup
- highlight “starred” comments by admin
- How to display html in only the first level of WP comments?
- Set noindex page-comment from Pages 2, 3 and More?
- Get the top level comment ID
- Custom WP Comments Query with Nested Comments Possible? (Hierarchy/Depth)
- Log file reports SQL Error processing child comments
- How can I assign a specific id to the last comment of a post
- Modify WordPress Comment From For AMP Html
- Get Post ID within wp_set_comment_status hook
- How to implement comments on specific fields in wordpress?
- delete duplicate comments
- Cancel comment filter?
- get_comments not working consistantly with post_id
- Comments are invisible, what’s the problem with wp_list_comments?
- WP confusing “links to my articles” with “comments”?
- How to check if a comment has replies?
- Can I have Comments open to specific users only?
- How to edit the text below “Leave a Reply”
- Safe to remove this: when using a 3rd Party Comment App? [closed]
- Commentlist: bypostauthor problem with children list
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Review count per product
- Moving post’s content to post’s comments section
- How to create post comment from different domain
- Comments on future posts
- Display custom text when comments are closed
- Returning error upon comment being flagged as spam
- I need to disable Disqus comments pre-approval, but i can’t find where
- JetPack comment threads are displaying above comment box? [closed]
- How do i remove approved spam comments by date?
- How to Trigger comment_form_after action if comment_form() not used
- Need Comment Link Help
- Page comes up blank using w3 total cache [closed]
- Comment Table Size Results in Slow Page Loads and 500 Errors
- Insert ads between comments
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- How to show username in reply to comment?
- Custom sort comments with select form
- Disallowed Tag Present in AMP WordPress ()
- Subcriber getting multiiple notifications for new comments
- Limit Comment Line Count – Add Read More Button
- Commenter username copies author username
- Fire Social Annex Code on Comment Approval
- Displaying comment rating stars in carousel
- Enable comments option
- Change Comment Text [duplicate]
- Comments closed but enabled on edit screen
- Let user delete comment on front end only
- How to force users to nest their comments
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Insert comment and still use moderation
- Auto approve all comments (editor)
- add field comment [duplicate]
- Let users comment on categories in WordPress
- Loop not displaying comments_popup_link
- Display of comment_date within get_comments?
- How to batch convert comments to posts?
- Customize comment notification e-mails with HTML
- prevent duplicate comments using wp_insert_comment
- I need help about wordpress of members section
- TinyMCE in comment reply form showing toolbar but can’t edit reply
- Add pending for reply comment in console WordPress