How do I put my comment form above the comments?
The comment list is output via wp_list_comments(), and the comment-reply form is output via comment_form(); so, just ensure that you call comment_form() before you call wp_list_comments().
The comment list is output via wp_list_comments(), and the comment-reply form is output via comment_form(); so, just ensure that you call comment_form() before you call wp_list_comments().
I was curious about any existing plugins and searched the plugin directory. There exists an old Sticky Comments plugin, I’m not related to it. It seems to use a sticky meta key. It uses a LEFT JOIN query but creates it’s own version of the whole comments_template() core function, to override the current query. One … Read more
You should try to replace <?php comment_reply_link(); ?> with: <?php comment_reply_link( $args ); ?> and to make sure the $args[‘depth’] is not zero or greater or equal than the $args[‘max depth’]. There will be no output if that’s not the case. If that doesn’t work, you could try to add the comment ID or the … Read more
There’s an excellent post here which, while it might not be completely balanced (it sets out from the start that it is against external commenting systems), it offers a good view of the cons of such systems. A quick summary of three main points (a mixture of my personal opinions and from the blog post): … Read more
Short answer: It doesn’t, but you can get around this: add_filter(‘comment_form_field_comment’, ‘my_comment_form_field_comment’); function my_comment_form_field_comment($default){ return false; } add_action(‘pre_comment_on_post’, ‘my_pre_comment_on_post’); function my_pre_comment_on_post($post_id){ $some_random_value = rand(0, 384534); $_POST[‘comment’] = “Default comment. Some random value to avoid duplicate comment warning: {$some_random_value}”; } If you want this only for certain pages, then you should create a custom page template, … Read more
Ok, I did some research based on בניית אתרים‘s solution here, as I’m interested in this too. First you need to get a list of blog IDs, and get_blog_list() is deprecated because it seems to be a “suicidal database query” 🙂 Anyway looks like there will be a alternative in WP 3.2 called wp_get_sites(). So … Read more
Final version of code used: function fb_comment_count($link = ‘link’) { global $post; $url=”https://graph.facebook.com/”; $posturl = get_permalink($post->ID); $url .= $posturl; $filecontent = wp_remote_retrieve_body(wp_remote_get($url, array(‘sslverify’=>false))); $json = json_decode($filecontent); $count = $json->comments; if ($count == 0 || !isset($count)) { $count = 0; } $comments = $count; if ($count == 1) { $comments .= ‘ Comment’; } elseif ($count … Read more
Ensure that you have Threaded Comments enabled: go to Dashboard -> Settings -> Discussion and enable the option to thread comments Ensure that your Theme enqueues the comment-reply script. Look for the following, usually in header.php, functions.php, etc.: <?php wp_enqueue_script( ‘comment-reply’ ); ?> Note: this call is usually wrapped in a conditional, such as: <?php … Read more
I have written a solution for that some time ago: <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Comment author URI to blog author page * Description: Changes the comment author URI to the blog’s author archive * Version: 2012.07.18 * Author: Fuxia Scholz * Author URI: https://fuxia.me * License: MIT * … Read more
If you prefer simple template files, you can do that with custom comment callbacks too. Call wp_list_comments() with a custom callback handler: wp_list_comments( array( ‘callback’ => ‘custom_comment_callback’, ‘style’ => ‘ol’ ) ); Now make that callback function very simple: function custom_comment_callback( $comment, $args, $depth ) { include ‘comment-template.php’; } And now you can use comment-template.php … Read more