Remove the function which adds nofollow to links in comments

Add this to your plugin file/theme’s functions.php: remove_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 ); You could then add your own filter to pre_comment_content to use wp_rel_nofollow selectively, based on your criteria. URLs that are automatically made clickable from plain-text urls like example.com aren’t filterable in a way that allows removing of the rel=”nofollow” attribute. The only solution … Read more

Is it possible to force login for comments only on custom-post-type or the custom comment template?

First, you will need to go into the comments template file and use get_post_type() to check if the post type is reviews. Then check if the user is logged in using is_user_logged_in(). If they are not logged in display message: “You must be logged in to post a comment.” If they are logged in, display … Read more

How can I get values count from wp_commentmeta?

Put the following function in your Theme’s functions.php and then put <?php echo tnc_reactions_count($post->ID); ?> in your single.php to output the numbers. Let me know if it works as I have not tested it completely. function tnc_reactions_count($post_id){ global $wpdb; $comments_table = $wpdb->prefix.’comments’; $commentsmeta_table = $wpdb->prefix.’commentmeta’; $get_post_comments = $wpdb->get_results( “SELECT * FROM $comments_table WHERE comment_post_ID=’$post_id'”, OBJECT … Read more

comment_form() Not changing the default class/id of elements

Those classes are being rendered inline because the id_form, class_form, and class_submit parameters should be placed within the $comments_args array (alongside title_reply, comment_field, etc) and not within the $fields array. See comment_form(). Also one last question, is there any way to re-arrange the order of the fields? Yes, the fields can be reordered. Here’s an … Read more