How to display comments and comment form on custom post type?
1) add “comments” to the supports array when registering the post type. 2) add the comments_template() function inside the loop of the single.php template and you are good to go.
1) add “comments” to the supports array when registering the post type. 2) add the comments_template() function inside the loop of the single.php template and you are good to go.
You can filter the output for the comment reply link on … wait for it! … ‘comment_reply_link’. Just do the same checks as the core function but return something else, in your case: nothing. <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 No Comment Log In Link * Plugin URI: http://wordpress.stackexchange.com/q/52350/73 * … Read more
The disqus plugin synchronizes your WordPress comments with the disqus system — that’s it’s main purpose (own your own comments, etc). You can get around this by ditching the built in WordPress commenting system altogether, modifying your theme templates (probably just comments.php) to use the stand-alone disqus javascript. <script type=”text/javascript”> var disqus_shortname=””; // required: replace … Read more
That sounds like a useful feature. To get what you need you have to change three things: Add a checkbox to enable anonymous comments per post. Save the checkbox value together with the post. Filter the checks for the comment registration requirement on the post views to enable the comment form and on the actual … Read more
As of the WordPress codex there is no such option. But you could just combine two or more comment arrays using plain PHP: array_merge( get_comments( array( ‘status’ => ‘hold’ ) ), get_comments( array( ‘status’ => ‘trash’ ) ) ); http://codex.wordpress.org/Function_Reference/get_comments http://php.net/array_merge
Not sure how it’ll behave with Disqus, but try the following filter: add_filter( ‘comments_number’, ‘comments_text_wpse_87886’, 10, 2 ); function comments_text_wpse_87886 ( $output, $number ) { return $number; } The original return is $output, and instead we are returning only the number of comments. That filter happens in the following core function, reproduced here if you … Read more
Quick answer: no. There is not a built-in function to create a new comment status. The status of a comment (or a post/page/attachment/etc) contains wide-spread implications thoughout your WordPress install, so you couldn’t just add one somewhere quickly. I’m not exactly sure what you’re trying to accomplish by adding this new “status”, but I think … Read more
There is definitely a performance advantage in keeping your comment spam to a minimum. If you have a lot of comments, the query time can get pretty out of control. To make it easier, you should install Akismet if you haven’t already. Akismet will automatically detect spam comments and move them to WordPress spam section. … Read more
The comment_notification_text filter is in wp-includes/pluggable.php in the wp_notify_postauthor function. You can copy and paste the $notify_message stuff and edit out what you don’t want. function wpd_comment_notification_text( $notify_message, $comment_id ){ // get the current comment and post data $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); // don’t modify trackbacks or pingbacks if( … Read more
It’s not a bug (gasp!) really just not provided for. You have to add a filter to do this, eg add_filter( ‘comments_clauses’, function ( $pieces, $query ) { if ( empty( $query->query_vars[‘wpse_no_password’] ) ) return $pieces; global $wpdb; $pieces[ ‘where’ ] .= $wpdb->prepare( ‘ AND ‘ . $wpdb->posts . ‘.post_password = %s’, ” ); return … Read more