Allow variable amount of comments before pagination

This have several components to it – what option itself holds and how value from it is stashed away and reused by various pieces of core code. I am not sure this is perfect, but my quick take would be: new Adjust_Comments_Per_Page( 10, ‘years’, ‘category’ ); class Adjust_Comments_Per_Page { private $amount; private $term; private $taxonomy; … Read more

Custom comment type based on thread level

I don’t know why somebody downvoted this question. This is a GREAT question. Yeah, that’s totally possible. What you would want to do is use comment_meta to store the titles. You could add the new field into the form using the ‘comment_form_top’ action. It runs before name, email, and url, and still runs if the … Read more

Aggregate comments, with pagination

Most likely, the main thing that you missed is that you must have “Break comments into pages” checked in the Settings Discussion Subpanel. The pagination functions require this to be set, as do the URL rewrites. Here’s a working, complete page template to do what you’re asking: <?php /* Template Name: All Comments See http://wordpress.stackexchange.com/questions/63770/aggregate-comments-with-pagination … Read more

Change Comment Author Display Name

You are missing a “NOT” logical operator (!) in your if statement. You want to say “if comment author IS NOT empty”. As of now, the function is reading that the author is not empty and defaulting to your else statement that tells it to output the author’s full name. Use the second block of … Read more

Paginate result set from $wpdb->get_results()

You can use the function paginate_links() for any pagination. For your specific case: $total = $wpdb->get_var(” SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE user_id = $thisauthor->ID AND comment_post_id = ID AND comment_approved = 1 “); $comments_per_page = 100; $page = isset( $_GET[‘cpage’] ) ? abs( (int) $_GET[‘cpage’] ) : 1; echo paginate_links( array( ‘base’ => add_query_arg( ‘cpage’, … Read more

Redirect user to a custom url after submitting the comment

Not quite; the redirect occurs inline inside wp-comments-post.php Use the filter comment_post_redirect to pass back any URL of your choice. Arguments passed are the default redirect & comment object, respectively. Based on your comments, here’s a suggestion: function wpse_58613_comment_redirect( $location ) { if ( isset( $_POST[‘my_redirect_to’] ) ) // Don’t use “redirect_to”, internal WP var … Read more