Get the top level comment ID

Wait? Did you just state get_comment_ancestors() does not exist? What were they thinking… We can do this by looping through the entire comment thread until we find the top level comment. We identify it by parent_comment being set to 0: /** * Return the top parent comment ID * * @param $comment_id * @return comment … Read more

How would I add the comment count to this sub-pages of current page snippet

A custom walker can be passed to wp_list_pages() using the $walker parameter. Here is a custom walker named WPSE_Walker_Page_Comment_Count() which is based on the default page walker, Walker_Page(). We’re only overriding the start_el() method in this case. The output has been customized to include the comment count. First, add the walker code to your theme’s … Read more

Customizing comments pagination for bootstrap

Just replace that snippet for this one: <?php $pages = paginate_comments_links([‘echo’ => false, ‘type’ => ‘array’]); if( is_array( $pages ) ) { $output=””; foreach ($pages as $page) { $page = “\n<li>$page</li>\n”; if (strpos($page, ‘ current’) !== false) $page = str_replace([‘ current’, ‘<li>’], [”, ‘<li class=”active”>’], $page); $output .= $page; } ?> <nav aria-label=”Comment navigation”> <ul … Read more

WordPress Comments are automatically publishing

An administrator is normal the highest level of user in WordPress. If you want to approve every comments, even administrator comments, maybe you can use the moderation filter. If you go to Settings > Discussion Settings > Comment Moderation. You could setup an “cache all” filter. If you put all letters of the alphabet and … Read more

Create comments.php form of custom HTML code

The comment_form() function is pretty customizable, and it accepts a variety of arguments. Take a look at these sample arguments, you can modify them to fit your needs: $fields = array( ‘author’ => ‘<input name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) .'” size=”30″ placeholder=”‘.__(‘Your name’,’text-domain’).( $req ? ‘ (Required)’ : ” ).'”/>’, ’email’ => ‘<input … Read more

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