Disqus resetting comment count to 0
After some further investigation I found that removing and re-installing the plugin has no negative effect on existing comments and resolved the issue.
After some further investigation I found that removing and re-installing the plugin has no negative effect on existing comments and resolved the issue.
I had a response from Disqus Support regarding this issue: Hi Scott, To clarify, the Disqus moderation panel in WordPress is not intended to be used with https. If you would like to use the moderation panel in https you’ll need to go to the Disqus moderation panel directly at: https://scotthelme.disqus.com/admin/moderate/#/approved If you have any … Read more
Use get_comments_number() to get … well … the number of comments. In your theme’s comments.php you can use its return value to do something: $num = (int) get_comments_number(); if ( 0 === $num ) echo ‘Be the first! But please don’t write just “First!”’; elseif ( 100 < $num ) echo ‘Yeah, add some noise. … Read more
Can’t post comment to blog in wp-multisite
There’s a filter for that: get_comments_link. Refer to source: return apply_filters( ‘get_comments_link’, $comments_link, $post_id ); In an appropriate place (such as a site functionality Plugin), just add a filter via callback: function wpse123906_filter_comments_link( $comments_link, $post_id ) { // Return your custom link return get_permalink( $post_id ) . ‘#disqus_thread’; } add_filter( ‘get_comments_link’, ‘wpse123906_filter_comments_link’, 10, 2 );
when you use jquery in wordress it is better to avoid using $() and use jQuery() instead. Don’t know the actual reasoning behind that but it is probably done that way to avoid collisions with other libraries that use the $ syntax.
If you use the comment_class function to add classes to each comment, comments by the post’s author can be styled via the bypostauthor class. You can alternately match the comment ID against the post ID: global $post; if( $comment->user_id === $post->post_author ) { // is author comment }
Does not show comment list
Editing your code to use a custom field is fairly trivial… function close_comments( $posts ) { if ( !is_single() ) { return $posts; } $cmeta = get_post_meta($posts[0]->ID,’your_field_name’,true); if ( $posts[0]->post_date_gmt < $cmeta ) { $posts[0]->comment_status=”closed”; $posts[0]->ping_status=”closed”; } return $posts; } add_filter( ‘the_posts’, ‘close_comments’ ); I am not sure that that approach is the right one … Read more