Disable or Enable Comments on Front end [closed]

Actually it’s there within WordPress by Default. If your WordPress editor is not showing it, then from the top left corner, click the Screen Options drop down menu. It’ll show some check boxes. Among those, there is one called Discussion. If you check that, then WordPress will show the option Allow Comments after the editor … Read more

Why is comments_template() working without a comments.php file?

If in the root of the folder of your theme there is no file “comments.php”. Than comments_template () include the file from the path “/wp-includes/theme-compat/comments.php”. To make changes in that file you can copy “comments.php” from this folder to the root of your theme. And then change as you like.

In wp_list_comments(), what is a short_ping?

This option is used to output a pingback comment. It’s passed to the Walker_Comment class, and if it’s set to true, it will output something similar to this: <li> <div class=”comment-body”> Pingback: <a href=”https://wordpress.stackexchange.com/questions/348102/author-url-here” rel=”external nofollow” class=”url”>Author Name</a> </div> The author URL is the field that users enter when filling out the comment form. Note … Read more

Display WordPress commenter nice name

wp_get_current_commenter() returns an array, the entry ‘comment_author’ stores the name: Array ( [‘comment_author’] => ‘Harriet Smith, [‘comment_author_email’] => ‘hsmith@,example.com’, [‘comment_author_url’] => ‘http://example.com/’ ) More information is available in the codex. Update To find the nice name, ask the DB: /** * Searches the user table by display name. * @param string $display_name * @return object … Read more

show if comment is in moderation

use the follow var: $comment->comment_approved and check for the value <?php if (0 == $comment->comment_approved) { ?> <em><?php _e(‘Your comment must approved.’, FB_BASIS_TEXTDOMAIN) ?></em> <?php } ?> code example: http://code.google.com/p/wp-basis-theme/source/browse/trunk/basis/comments.php

Make wordpress comments work with include templatepath

Short answer: you can’t. Longer answer: You can include comments.php as a template-part file inside another template, via: get_template_part( ‘comments.php’ ) …but that won’t actually make comments work, because the comments_template() template tag does far more than merely include the comments.php template-part file. In order to make comments actually work when using get_template_part() as opposed … Read more

Show only if x comments?

wp_count_comments() returns the number of comments either for the whole blog or just for the current post. Example: if ( 10 < wp_count_comments( get_the_ID() )->approved ) echo ‘Wow, more than 10 comments!’;

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)