Displaying Your Most Commented Posts

September 16, 2008

Though this isn’t quite the same as displaying your most popular posts in your sidebar, here is some code you can use to display the posts that have received the most comments.  You’ll want to place it in your sidebar where you want the code to be displayed. Most Commented Posts Code Go into your theme files and go to header.php file.   Somewhere within the </head> you’ll want to place the following code: <?php most_popular_posts($no_posts = 5, $before = '<li>', $after = '</li>', $show_pass_post... [Read the full story]

Rearrange WordPress Comments

July 15, 2008

If you have to re-arrange how the comments appeared and if for some reason you need this function all you have to do is a minor edit of /wp-includes/comment-template.php.       Original Code: // TODO: Use API instead of SELECTs. if ( $user_ID) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date"); } else if ( empty($comment_author) ) { $comments = $wpdb->get_results("SELECT... [Read the full story]

Adding Recent Comments To Your WordPress Theme

July 15, 2008

By default, most WordPress themes display Recent Comments in some form or another. Unfortunately, it isn’t usually very user-friendly, so it will often get removed.   Until now, most of your other options required the use of a WordPress plugin, but today I ran across a great code snippet you can use to display recent comments in a useful format. I just tested it out on my test site and it looks good. Here is the code you will want to paste into your theme’s sidebar: <h2>Recent Comments</h2> <?php global... [Read the full story]

Separate WordPress Comments and Trackbacks

July 14, 2008

With all the WordPress themes available to WordPress users, it always surprises me how these incredible theme authors don’t take a few extra seconds to separate their theme’s trackbacks from the comments. It doesn’t look very professional and it can make it extremely difficult to follow a conversation in the comments. Separating your trackbacks and comments requires a minimal amount of coding work to set up. First, you’ll want to make a backup of your comments.php file just in case something goes wrong. Next, follow... [Read the full story]

Separating Your Author Comments in WordPress

July 14, 2008

Have you noticed while visiting some of your favorite blogs that many author comments are styled differently to help the authors comments to stand out?   This is something that isn’t overly difficult to implement on your WordPress blog, so I decided to write a quick how-to post explaining how you can easily adjust your WordPress theme to display different styles for each author. First, you’ll need to make some adjustments to the comments.php code.   Look for something similar to the following code: <li class="<?php... [Read the full story]