Where to insert get_comments?

I would rarely use ‘echo’ in WordPress template themes because it can cause output to appear before the loops are even executed (aka, at the top of the page). In this instance, I used the get_comments function within a function that hooked onto the content output: add_filter(‘the_content’, ‘includePosts’, 1); Within the function includePosts, I have … Read more

Comment submission & navigation redirects to default language

I’ve figured out the solution to my problems. Here’s what I did… Note: This is considering the posts, thus comments, are under the ‘Article‘ post-type, which thus create the permalink such as this: site.com/article/post-name/#comments. Adjustments should be made for other uses. To fix problem #1 & #3: if ( !is_admin() ) add_filter(‘get_comment_link’, ‘my_comment_post_redirect’); function my_comment_post_redirect($location){ … Read more

Display of comment_date within get_comments?

The way you’re doing this, you’re going to get the raw SQL date that’s stored in the wp_comments table. You can still use the convenience functions like comment_date with get_comments. In this case, we’ll use get_comment_date. The first argument is the date format — if you leave it blank, WP will use whatever date format … Read more

Comment time is same as the post time

Try to use the wp_list_comments function: http://codex.wordpress.org/Function_Reference/wp_list_comments It allows you to control the aspect of every comment, also the replies. Then, you define a callback function, which will be called when WordPress creates each comment. Your callback needs to start like this: function commnents_callback($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; global $post; // your HTML … Read more

writing a plugin, how to disable the comment form altogether?

You can control whether comments appear by filtering the comments_open() function. Here is an example from the WordPress codex: add_filter( ‘comments_open’, ‘my_comments_open’, 10, 2 ); function my_comments_open( $open, $post_id ) { $post = get_post( $post_id ); if ( ‘page’ == $post->post_type ) $open = false; return $open; }