I have a problem with wordpress function. I'm using function: query_posts("showposts=20&orderby=comment_count&order=DESC");. Error occurred: The list of posts incorrect order. Who can help me?
I don't know anything about wordpress but I know the Dummies series has a book on it. You could try looking there.
<?php $current_month = date('m'); ?> <?php $current_year = date('Y'); ?> <?php query_posts("cat=22&year=$current_year&monthnum=$current_month&order=ASC"); ?> try like this
I don't see comment_count as an accepted parameter for query_posts | orderby http://codex.wordpress.org/Template_Tags/query_posts#Orderby_Parameters
Try this out $posts = $wpdb->get_results("SELECT ID, post_title, comment_count FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 7"); Then you can retrieve the post ID,post Title and count using this "$posts" variable. use it inside a for each loop. i.e : $id = $post->ID;