Admin – Dashboard – Unset recent comments

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

How Can I display the Current Logged-In User’s Comment at the Top of the Comments Section in WordPress?

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

Posting a comment redirects admin/users to blank page

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

Newest comments first not working

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’ )); ?>

How can I return the result of my custom function?

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.

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