How Do I Remove Comment Date and/or Comment Date Link

Check if your theme has its own comment template by going to [yoursite.com]/wp-admin/theme-editor.php (when logged in as an administrator). Then look at the right column and try to find comments.php file. If it’s there, it controls the way your comments are displayed, so you can manually delete hyperlinks and dates from it. If you can’t … Read more

Adding Comment Meta to a new comment notification email

The solution was to add a priority number to the comment_post action that was saving my rating value, as shown below: function save_comment_meta_data( $comment_id ) { if ( ( isset( $_POST[‘rating’] ) ) && ( $_POST[‘rating’] != ”) ) { $rating = wp_filter_nohtml_kses($_POST[‘rating’]); add_comment_meta( $comment_id, ‘rating’, $rating ); } } add_action( ‘comment_post’, ‘save_comment_meta_data’, 5 ); … Read more

Conditional tag for comments

The comments popup page contains a loop of the comments, which can be checked by an is comments popup() conditional, that returns either true or false. However, i don’t see this feature being used in modern development. This might be the only place containing a direct loop of comments. The $wp_query itself does not contain … Read more

How to get the average of the values from the comment meta

If you need to show the averages in the content, you need to pre-calculate them (before showing the comments). My approach would be having a custom meta in the post with the calculated averages and modify those metas every time a new comment (rating) is saved. Something like add_action(“comment_post”, “wpse16733_updateAVGs”); function wpse16733_updateAVGs($comment_ID, $approved){ if ($approved){ … Read more

How to put this result inside that result?

Run the loop in advance and populate an array, which in turn you include in the $result afterward. <?php // Create an empty array $comlistall = array(); foreach ( $comments as $comment ){ $comlistall[] = $comment; // <= Populate the array with the comments in the loop }; $rtitlez = get_the_title(); $rimgz = get_the_post_thumbnail_url(get_the_ID(), ‘full’); … Read more