What are the current recommended best-practices for comments.php?

You really don’t need much. A headline with id=comments <h2 id=”comments”><?php comments_number(); ?></h2> This will be the target for comments_link() in the article loop. Links for paginated comments. Usually, I put these links into a function and call the function above and below the comments list: class TTT_Template { function comment_pager() { if ( get_comment_pages_count() … Read more

How is comment spam received without a comments form?

You don’t need a form to submit a comment to the wp-comments-post.php file, or to send a pingback or trackback. Spammers don’t use forms, they simply send their spam directly. Removing the form doesn’t “turn off” comments. To do that, go to the Posts screen, and use the Quick Edit to actually disable comments and … Read more

Add placeholder attribute to comment form fields

You should filter ‘comment_form_default_fields’ to add the placeholder attribute. Sample code add_filter( ‘comment_form_default_fields’, ‘wpse_62742_comment_placeholders’ ); /** * Change default fields, add placeholder and change type attributes. * * @param array $fields * @return array */ function wpse_62742_comment_placeholders( $fields ) { $fields[‘author’] = str_replace( ‘<input’, ‘<input placeholder=”‘ /* Replace ‘theme_text_domain’ with your theme’s text domain. * … Read more

Show content only if member left a comment

Check if the user has left a comment // the user may have commented on *any* post define( ‘CHECK_GLOBAL_FOR_COMMENTS’, TRUE ); // // some more code // function memberviparea( $atts, $content = null ) { $post_id = 0; // if the user have to left a comment explicit on this post, get the post ID … Read more

How to remove comment spam in WordPress

Just install a good anti-spam plugin. They will monitors site’s comments for spam and automatically blocks spam comments. BTW WordPress come with Akismet which is a spam protection plugin installed by default. To enable the plugin, go to the Plugins and activate the Plugin. Akismet Anti-Spam

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