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; }

Image Upload Form is Disabling Comment Addition

Well, this is definitely a little hackish but what I ended up doing was changing the action on the form to “[mysite url]/wp-comments-post.php”. Then I took advantage of a few action hooks in wp-comments-post.php to hijack that page: add_action(‘pre_comment_on_post’, array($this, ‘process_image_upload’)); And if anyone is curious as to how I wrote the process_image_upload function (which … Read more

Why might a comment turn red on approval?

Got it figured, so I’m closing this question out. Here was the problem: on comment approval, I had some custom stuff hooked, and this custom stuff was throwing an error. This error was being included as part of the comment approval’s AJAX response. It turs out that on listings pages in the admin, if WordPress … Read more

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