how to properly use comments-template.php

It depends on how your theme is built & we can’t be 100% sure if this is right without seeing the code but most probably comments_template is the wrong function. Take a look at the comment_form function http://codex.wordpress.org/Function_Reference/comment_form comments_template is the function generally used to include the comments file(basically to display the contents of comments.php, … Read more

Customizing comments pagination for bootstrap

Just replace that snippet for this one: <?php $pages = paginate_comments_links([‘echo’ => false, ‘type’ => ‘array’]); if( is_array( $pages ) ) { $output=””; foreach ($pages as $page) { $page = “\n<li>$page</li>\n”; if (strpos($page, ‘ current’) !== false) $page = str_replace([‘ current’, ‘<li>’], [”, ‘<li class=”active”>’], $page); $output .= $page; } ?> <nav aria-label=”Comment navigation”> <ul … Read more

Change the HTML of the comment form that is generating somewhere from the core WordPress

You can write your own custom HTML structure for comment listing. Inside your comments.php file, there will be a call to wp_list_comments() function. Find it, and pass your own function as its callback: wp_list_comments( array( ‘callback’ => ‘my_function’ ) ); Now, create a callback function and start implementing your own HTML structure. This function accepts … Read more

How to change commenter links to /user/user_id?

You can use the get_comment_author_link hook, which is part of the get_comment_author_link() template tag, like your question already suggests. Then you only have to get the according user_id, which can be done via the $comment global, and construct the link you want accordingly. Exemplary usage like shown below: add_filter( ‘get_comment_author_link’, ‘wpse144835_custom_comment_author_link’ ); function wpse144835_custom_comment_author_link( $link … Read more