Change WordPress comments url / word

In your functions.php add ( there are other rules relating to comment pages you can see them all with Rewrite Rules Inspector plugin, this one just covers the case you mention ) add_rewrite_rule ( ‘(.?.+?)/customname-([0-9]{1,})/?$’, ‘index.php?pagename=$matches[1]&cpage=$matches[2]’, ‘top’ ); you’ll also need to find in your theme ( possibly in your function.php ) where the comments … Read more

using wp_query to return posts w/ comment count > 0

While the WP_Query class has the native possibility to orderby the comment_count, it doesn’t have the same to query based on those. But when we look at the posts-table, we can see that there isn’t much we need to alter ID | post_author | post_date | post_date_gmt | post_content | post_title | post_excerpt | post_status … Read more

How does WooCommerce display a custom comment_type in Comment Admin?

To answer your first question: »How does WooCommerce add the comment_type of order_note to the dropdown in Comment Administration?«. From woocommerce-admin-init.php: function woocommerce_admin_comment_types_dropdown( $types ) { $types[‘order_note’] = __( ‘Order notes’, ‘woocommerce’ ); return $types; } add_filter( ‘admin_comment_types_dropdown’, ‘woocommerce_admin_comment_types_dropdown’ ); Of course you have to do your own, to avoid conflicts, like this: add_filter( ‘admin_comment_types_dropdown’, … Read more

How to check if commenter is the_author?

Not sure what you are meaning to do but, if you take a look at the get_comment_class() function that is responsible for generating the .bypostauthor class you can see how it determines if the commenter is the author if ( $post = get_post($post_id) ) { if ( $comment->user_id === $post->post_author ) $classes[] = ‘bypostauthor’; } … Read more

How to add a div on comment fields / edited

The comment_form() isn’t quite correct with your arguments being loaded in. You need to pass in ‘fields’ => apply_filters( ‘comment_form_default_fields’, $fields ), into a new argument. Attached is an example of what you would need to update. Fields you want to have filled out $fields = array( ‘author’ => ‘<div class=”comment-form-author”><label for=”author”>’ . __( ‘Name’, … Read more

Separated Comment from Post

ahaaa 😀 it’s success, I use CSS. Here the screenshot the code i use on single.php : <!– post section –> <section class=”post-section all-round grid”> <div class=”content_wrapper”> <!– YOUR CONTENT –> </div> </section> <!– end .post-section –> <!– comment section –> <section class=”comment-section all-round grid”> <?php if ( comments_open() || get_comments_number() ) : ?> <?php … Read more

Display comment meta data after quick update

I think the action wp_ajax_get-comments is not triggered, if you quick-update the comment. You should check, which ajax request is triggered on the update and then change your code into: if( doing_action( ‘wp_ajax_get-comments’ ) || doing_action( ‘wp_ajax_quick-update-action’ ) ){ … } I am not able to test this code at the moment, but i hope … Read more

Multiple Comment Forms in a single page [closed]

You can pass the number argument to get_comments() to retrieve only a specific number of comments. They will, by standard, be sorted descending, so you get the latest comments first. As WordPress automatically seperates comments for each post, you will not have to worry about mixing comments up. This seems to be the easiest way … Read more

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