comment_notes_before not working

As noted by @birgire, the comment_notes_before argument is only shown to users who are not logged in. If you look at the source, there is an if construct that checks if a user is logged in. If they are logged in, then a filter and an action fired. If not, then the comment_notes_before text is … Read more

Custom markup for the comment form

Yeah this should be possible using the comment_form_default_fields filter, like so: apply_filters( ‘comment_form_default_fields’, $fields ); $fields = array( ‘name’ => ‘<section class=”form-group”> <input type=”text” class=”form-control” id=”name” placeholder=”Your name” /> </section>’ ); Just remember to add any other fields that you want to add into that array too.

duplicate comment section functionality and call it something else for custom post types

You can still use the core comment functionality for the custom post type, then filter the edit-comments.php admin screen and create a new admin page with the required comments table. Step 1. Removing the comments from the edit-comments.php admin screen can be done by using the comments_clauses filter: <?php // Remove comments for specific post … Read more

get_comments_number() returns 0

From quick look at the source there seems to be three possibilities: get_post() returned falsy value, so current post context is invalid in some way. $post->comment_count is 0. get_comments_number filter is being used to adjust the output. Most commonly it would be case 1/2 with something interfering with global post context, dump get_post() at the … Read more

Fetching Initials of the Commentator in the WordPress Website

Here is function that return you the comment author initials by the comment id function get_comment_author_initials($comment_id) { $author = get_comment_author($comment_id); $words = explode(” “, $author); $initials = null; foreach ($words as $w) { $split = mb_str_split($w); // to cover unicode char $initials .= $split[0]; } return $initials; } function mb_str_split( $string ) { return preg_split(‘/(?<!^)(?!$)/u’, … Read more

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