sort by number of comments
-
i’m having a hard time doing something that i would think be fairly easy. i’m trying to display all my posts on my main page in ascending order, by the number of comments each has.
i’ve gone into my theme’s index file and right before The Loop added….
$posts = query_posts($query_string . '&orderby=comment_count&order=asc&posts_per_page=-1');
…directly after that i start the if statement of The Loop. i’m not getting any errors, the page displays fine. the problem is that the comment_count column of the db isn’t incrementing when i add a comment. what am i doing wrong?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘sort by number of comments’ is closed to new replies.