FILE: /wp-content/plugins/show-all-comments-in-one-page/bt-comments.php
wp_list_comments(array(
'reverse_top_level' => null, //(bool)
'reverse_children' => '', //(bool/null)
As these are checked on strict – both require correction:
'reverse_top_level' => false,
'reverse_children' => false,
(it is possible that you code work(ed) on pre 4.5, but on WP 5.2+ results in incorrect order)
]]>This same issue was discussed five years ago–comments are out of order–but there was no firm solution. Someone opened a trac ticket, but what was discussed and resolved there had to do with threaded comments. My issue has to do with the original comment, not threaded comments, being out of order.
You can see comments from 2014 mixed in with comments from 2013 in this post.
This is the date order beginning at the point where it gets odd–
Oct. 2013*
Feb. 2014
March 2014
April 2014
May 2014
June 2014
July 2014
Sept. 2014*
July 2013*
July 2014
Any thoughts or suggestions?
Thank you.
]]>array (size=10)
'comment 0' =>
array (size=2)
'comment_id' => string '22' (length=2)
'parent_of' => string '0' (length=1)
'comment 1' =>
array (size=2)
'comment_id' => string '23' (length=2)
'parent_of' => string '0' (length=1)
'comment 2' =>
array (size=2)
'comment_id' => string '24' (length=2)
'parent_of' => string '0' (length=1)
'comment 3' =>
array (size=2)
'comment_id' => string '25' (length=2)
'parent_of' => string '0' (length=1)
'comment 4' =>
array (size=2)
'comment_id' => string '26' (length=2)
'parent_of' => string '24' (length=2)
'comment 5' =>
array (size=2)
'comment_id' => string '27' (length=2)
'parent_of' => string '22' (length=2)
'comment 6' =>
array (size=2)
'comment_id' => string '28' (length=2)
'parent_of' => string '0' (length=1)
'comment 7' =>
array (size=2)
'comment_id' => string '29' (length=2)
'parent_of' => string '25' (length=2)
'comment 8' =>
array (size=2)
'comment_id' => string '30' (length=2)
'parent_of' => string '29' (length=2)
'comment 9' =>
array (size=2)
'comment_id' => string '31' (length=2)
'parent_of' => string '27' (length=2)
this is a var_dump of comment_ID and comment_parent.
order output:
22, 23, 24, 25, 26, 27, 28, 29, 30, 31
right order
22 -> 27 -> 31, 23, 24 -> 26, 25 -> 29 -> 30, 28
[No bumping. If it’s that urgent, consider hiring someone.]
]]>“Comments should be displayed with the newer comments at the top of each page”
I presume this means LIFO (i.e., most recent comment at the top) however mine is showing as FIFO (i.e., first comment is at the top.
Is there any way to make this work as intended?
]]>Anyway the problem I’m having is comments are showing up in random places.
For example this comment:
https://www.thenutgraph.com/fear-of-the-cross/#comment-19984
Which is from August 11th but is showing up before July 27th.
The comment is not in reply to anything and I even checked the database, the comment is listed with a comment_parent value of 0.
mysql> select comment_parent from wp_comments where comment_ID =’19984′;
+—————-+
| comment_parent |
+—————-+
| 0 |
+—————-+
I’ve also switched to the default theme (twenty-ten) and it’s exactly the same so it’s not a theme issue.
This issue is occurring quite a lot and many users are complaining their comments are not showing up in order.
Any ideas on how I can go about finding the problem, and of course rectifying it.
]]>I’m the author of a popular plugin “Comment Rating” which allows readers voting a comment in a Likes vs. Dislikes fashion. I plan to store a form of the voting result in the comment_karma field in the comment table, and use the comment_karma field to sort the display order of the comments.
However, get_comments() in wp-includes/comment.php hardcodes the ‘orderby’ field to ‘comment_date_gmt’. Please make remove the hardcode.
I was also requested by the users to avoid displaying poorly rated comments. It’d be most helpful if get_comments() allows a SQL condition to be passed. For example, ‘comment_karma > -10’ can be passed to the WHERE SQL statement.
Thanks so much.
Bob King
https://wealthynetizen.com/
<?php get_header(); ?>
<div id=”bd” class=”yui-navset”>
<div id=”yui-main”>
<div class=”yui-b” >
<div class=”yui-g”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!– item –>
<div class=”item entry” id=”post-<?php the_ID(); ?>”>
<div class=”itemhead”>
<h3>” rel=”bookmark”><?php the_title(); ?></h3>
<div class=”chronodata”><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></div>
</div>
<div class=”storycontent”>
<?php the_content(‘Read more »’); ?>
</div>
<small class=”metadata”>
<span class=”category”>Filed under: <?php the_category(‘, ‘) ?> <? if(!is_single()) echo “|”; ?> <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘Comment (0)’, ‘ Comment (1)’, ‘Comments (%)’); ?></span>
<?php if ( function_exists(‘wp_tag_cloud’) ) : ?>
<?php the_tags(‘<span class=”tags”>Article tags: ‘, ‘, ‘ , ‘</span>’); ?>
<?php endif; ?>
</small>
</div>
<!– end item –>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; ?>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(‘« Previous Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(‘Next Entries »’) ?></div>
<p> </p>
</div>
<?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php endif; ?>
<!– end content –>
<!– 2nd sidebar –>
<!– end 2nd sidebar –>
</div>
</div>
</div>
<div class=”yui-b” id=”secondary”>
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>
I went to Settings -> Discussion and found this:
Comments should be displayed with the “oldest or newest” comments at the top of each page.
I changed it from “oldest” to “newest” and nothing changed. The comments are still in order of “oldest”. Am I not understanding what this setting is supposed to change?
Jill
]]>