Identify and display the fact that user is admin next to username in comment section

From inside a comment Loop… $author_data = get_user_by(‘login’,$comment->comment_author); if (!empty($author_data)) { var_dump($author_data->roles); } $author_data->roles is an array so you will need to work out what you want to do with that. That is, print them all? Print the highest ranking role? if (array_intersect(array(‘administrator’,’moderator’),$author_data->roles)) { echo ‘admin’; } elseif (array_intersect(array(‘something’,’else’),$author_data->roles)) { echo ‘something else’; }

delete user not working

WordPress should give this option below Attribute all posts to: Anyhow, I wrote a post on this (Clean Comments Table After User Deleted) Edit Also, you can move your all posts from deleted users to admin user. global $wpdb; $admin_id = 1; // Assign admin user id here $posts_table = $wpdb->prefix . ‘posts’; $users_table = … Read more

I want to fill the comment with the comment count?

I think the reason for your header already sent error is that you are using comments_number() that will echo the value. Try instead get_comments_number( $post_id ); to return it. The Codex info on this function says that it returns the total number of comments, trackbacks, and pingbacks for the post.

Show ‘add comment’ link for status updates in Twenty Thirteen

Open up the /wp-content/themes/twentythirteen/functions.php file and change the line $format_prefix = ( has_post_format( ‘chat’ ) || has_post_format( ‘status’ ) ) ? _x( ‘%1$s on %2$s’, ‘1: post format name. 2: date’, ‘twentythirteen’ ): ‘%2$s’; to $format_prefix = ( has_post_format( ‘chat’ ) || has_post_format( ‘status’ ) ) ? _x( ‘%1$s on %2$s – show/leave comments’, ‘1: … Read more

Display only posts with comments

Since you are in a loop you can use the function get_comments_number(). Retrieves the value of the total number of comments, Trackbacks, and Pingbacks for a post. This tag must be within The Loop. Unlike comments_number() this function will return the value as a numeric value. Use it for example as follows: $num_comments = get_comments_number(); … Read more

Media upload in add comment meta box

You could start with this : add_action( ‘comment_form_logged_in_after’, ‘wpse_102612_additional_fields’ );// only for logged users function wpse_102612_additional_fields () { echo ‘<p class=”comment-form-upload”>’. ‘<label for=”upload”>’ . __( ‘Upload your file’ ) . ‘</label>’. ‘<input id=”upload” name=”upload” type=”file” size=”30″ /></p>’; }

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