comments reply script not working

Don’t link the script file directly. Enqueue it instead, e.g. in functions.php: function mytheme_enqueue_comment_reply() { // on single blog post pages with comments open and threaded comments if ( is_singular() && comments_open() && get_option( ‘thread_comments’ ) ) { // enqueue the javascript that performs in-link comment reply fanciness wp_enqueue_script( ‘comment-reply’ ); } } // Hook … Read more

Comment Walker vs. Comment Callback

We could rewrite: wp_list_comments( array( ‘callback’ => ‘bootstrap_comment_callback’, )); with the null walker parameter: wp_list_comments( array( ‘walker’ => null, ‘callback’ => ‘bootstrap_comment_callback’, )); which means we are using the default Walker_Comment class: wp_list_comments( array( ‘walker’ => new Walker_Comment, ‘callback’ => ‘bootstrap_comment_callback’, )); The Walker_Comment::start_el() method is just a wrapper for one of these protected methods: … Read more

How to wrap submit button of comment form with div

We can use comment_form function’s submit_button parameter to change submit button HTML. Default HTML for submit_button is <input name=”%1$s” type=”submit” id=”%2$s” class=”%3$s” value=”%4$s” /> You can change your code like this. $comments_args = array( …. ‘submit_button’ => ‘<div class=”form-group”> <input name=”%1$s” type=”submit” id=”%2$s” class=”%3$s” value=”%4$s” /> </div>’ …. ); Update: Regarding %1$s , %2$s and … Read more

How to add a class to the comment submit button?

If you check out the source of the function comment_form(), you’ll see it doesn’t even print a class on the input; <input name=”submit” type=”submit” id=”<?php echo esc_attr( $args[‘id_submit’] ); ?>” value=”<?php echo esc_attr( $args[‘label_submit’] ); ?>” /> I’m guessing you need to add a class for styling? Why not modify your CSS to just; input.submit, … Read more

Removing the “Website” Field from Comments and Replies?

Create a file in wp-content/plugins/ with this code: <?php /* Plugin Name: Get Rid of Comment Websites */ function my_custom_comment_fields( $fields ){ if(isset($fields[‘url’])) unset($fields[‘url’]); return $fields; } add_filter( ‘comment_form_default_fields’, ‘my_custom_comment_fields’ ); Normally, I’d say put it into your theme’s functions.php file, but I wouldn’t recommend doing that for a theme that could update like Twenty … Read more

How to rearrange fields in comment_form()

That’s pretty simple. You just have to take the textarea out of the default fields – filter ‘comment_form_defaults’ – and print it on the action ‘comment_form_top’: <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Comment Textarea On Top * Description: Makes the textarea the first field of the comment form. * Version: … Read more