get_comments not working properly after WordPress v4.4 update
get_comments not working properly after WordPress v4.4 update
get_comments not working properly after WordPress v4.4 update
The recent comments list is part of the Activity Dashboard Widget. Approach #1 We could remove that dashboard widget and then add our modified version of it: /** * Remove the latest comments from the Activity dashboard widget (approach #1) */ add_action( ‘wp_dashboard_setup’, function() { // Remove the Activity widget remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’ ); … Read more
By the way, you don’t need the plug-in to break your comments into pages. This can be done by default, you have to chose and set some settings according to your needs though. You will find the according settings section under »Settings > Discussion > Other comment settings > “Break comments into pages..”« in your … Read more
comment_moderation_subject is not working for me
Alright, I figured it out. Thanks for all the direction everyone! <?php global $current_user,$post; $args = array(‘user_id’ => $current_user->ID,’post_id’ => $post->ID); // The Query $comments_query = new WP_Comment_Query; $comments = $comments_query->query( $args ); // Comment Loop if ( $comments ) { foreach ( $comments as $comment ) { echo ‘<p>’ . $comment->comment_content . ‘</p>’; } … Read more
Can you access your site via FTP or through your host control panels file manager? If you can, check to see if there is any code within wp-comments-post.php in the root of your site. If it is empty, paste this inside: <?php /** * Handles Comment Post to WordPress and prevents duplicate comment posting. * … Read more
Just with JS there is no way, because the visitor can reload the page or close window and reopen and reset everything. You can create a table in your wordpress database where the user’s name will be saved with 0 (if no comments was done) and the id of the post (if commented). So in … Read more
You have no need callback function. Only reverse_top_level: true is find for what you want to do. Just remove ‘callback’ => ‘custom_comments_callback’, from your array. <?php wp_list_comments(array( ‘reverse_top_level’ => true, ‘avatar_size’ => 50, ‘reply_text’ => ‘Reply to this comment’ )); ?>
I don’t know what your comments.php looks like, so I cannot tell how to adapt your current code, but I can generally tell you how to approach this. Normally, WP will assume that you want the latest comments of the current post. If you want something else, you start with the condition under which you … Read more
Seems pretty much simple: add_filter( ‘get_comment_author_link’, ‘attach_city_to_author’ ); function attach_city_to_author( $author ) { $city = get_comment_meta( get_comment_ID(), ‘city’, true ); if ( $city ) $author = $city; return $author; } Unless if you are adding the city name somewhere else and wanted to remove comment author name then call add_filter(‘get_comment_author’, ‘__return_false’); Hope that helps.