COMMENT_ID() because it does not work?
-
Where did you download this theme from?
has not been downloaded, it is my theme I’m working on.
I do not understand in what context should be usedSo where did you get the
COMMENT_ID()
function from? That’s not a template tag or core WordPress function.here: http://codex.wordpress.org/Function_Reference/comment_ID
or… sorry for cap slock
Have you read that page? That function just display the id of the current comment. Have a look at comments.php in Twenty Eleven for an example of what you should be using.
hi!
I tried it, Twenty Eleven uses wp_list_comments, would be fine, we would pass a function to get the ID in the right order (including reply), but then print in the page div or ul/ol
I do not need.I only need the ID of the comments in the right order, I will not print anything.
I’m trying to write a function to sort the comments, but it’s like re-inventing the wheel, WP already makes thisI’d suggest that you start by looking for a suitable plugin and hacking/borrowing from it if necessary.
you mean by hacking?
I edit core_file of wp?
write a plugin?can you give me the instructions, I do not know where to start
thank you!
I edit core_file of wp?
No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.
I meant you could hack the plugin.
yes, you’re right, it would be a problem for the next update
this is my comment.php
<?php function fake($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $GLOBALS['fake'][] = get_comment_ID(); } wp_list_comments('type=comment&callback=fake'); var_dump($GLOBALS['fake']); ?>
if I use div as an option for style, writes div instead of ul/ol
Don’t use $GLOBALS in WordPress. What is it that you’re trying to do with that callback function?
imagined that Global was not a good idea …
fake() is the only way I’ve found to get the right order of the comments
What is the right order?
order of comment in $comments
comment 10
comment 11
comment 12 is reply to 10
comment 13
comment 14 is reply to 11
comment 15 is reply to 11
comment 16 is reply to 14right order
comment 10
comment 12 is reply to 10
comment 11
comment 14 is reply to 11
comment 16 is reply to 14
comment 15 is reply to 11
comment 13You don’t need to do anything! WordPress will order the comments by default if you use wp_list_comment() AND you configure WP to display threaded comments in Settings -> Discussion.
- The topic ‘COMMENT_ID() because it does not work?’ is closed to new replies.
(@morpe)
11 years, 7 months ago
in my comments.php there is only COMMENT_ID (),
I tried “echo get_comment_id()”
but does not work
I just want the right order of the comments.
how do you?