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

Display comments of users on single page

You can use the get_comments function to retrieve comments from a specific user. $comments = get_comments( array( ‘user_id’ => 1 ) ); foreach( $comments as $comment ) { $post_id = $comment->comment_post_ID; $post = get_post( $post_id ); setup_postdata( $post ); echo ‘<a href=”‘ . get_permalink() . ‘”>’ . get_the_title() . ‘</a>’; echo $comment->comment_author . ‘<br />’ … Read more

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