Customize Theme comment template to Insert VoteUp and VoteDown buttons
Customize Theme comment template to Insert VoteUp and VoteDown buttons
Customize Theme comment template to Insert VoteUp and VoteDown buttons
You need to include comments functionality via comments_template(), because this function doesn’t merely include the comments.php, file, but also handles all of the querying and functions required for displaying comments. While the Codex doesn’t really get into details, you can see, by looking at source, what’s going on: <?php /** * Loads the comment template … Read more
to remove it from the left. Delete the line containing wp_list_comments from comments.php to display user name add comment_author();, for email use comment_author_email(); & for url use if(get_comment_author_url()) comment_author_url();. comment_text() is already there. These all go in the markup inside the function in functions.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
Add style=ol to your call to wp_list_comments. Reference: http://codex.wordpress.org/Function_Reference/wp_list_comments#Parameters
When registering a custom post type you need to enable comments. In the arguments defining the CPT, you need to include something like this: ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’ ) The example on the Codex is shows where this option needs to go, this page also shows a list of other … Read more
Your action is called whenever comments.php loads because you’re explicitly running it with do_action. Both the function and add_action should be in functions.php, and do_action should be removed entirely.
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
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
According to the documentation, the only required files in a theme are style.css and index.php. All other files are optional. You can use the ones you need and discard the ones you don’t need. If you haven’t seen it, I’d recommend you check out WordPress’s developer site on the topic of themes.