Is comment metadata included in the export file?

My latest export from my blog (WP 3.3.1) now has the commentmeta in the XML. It’s in this format: <wp:comment> <wp:comment_id>…</wp:comment_id> … <wp:comment_user_id>0</wp:comment_user_id> **<wp:commentmeta> <wp:meta_key>name_of_meta</wp:meta_key> <wp:meta_value><![CDATA[value_of_meta]]></wp:meta_value> </wp:commentmeta>** </wp:comment> I was looking for information on it while trying to write an exporter from another system. Not much information available online so I tried an export from … Read more

Separete trackbacks/pings and numbered comments

For numbering, in your comment.php, change this: wp_list_comments(‘callback=mytheme_comment’); To this: wp_list_comments(array( ‘callback’=>’mytheme_comment’, ‘style’=>’ol’, )); For separation into comments and pingbacks, you’d do something like this: wp_list_comments(array( ‘callback’=>’mytheme_comment’, ‘style’=>’ol’, ‘type’=>’comment’, )); wp_list_comments(array( ‘callback’=>’mytheme_comment’, ‘style’=>’ol’, ‘type’=>’pings’, ));

Follow-up Comments Notification Without a Plug-in

It’s quite simple, just hook a function on comment_post in which you check if the comment is a reply and send the author of the parent comment an email: add_action(‘comment_post’, ‘notify_author_of_reply’, 10, 2); function notify_author_of_reply($comment_id, $approved){ if($approved){ $comment = get_comment($comment_id); if($comment->comment_parent){ $parent_comment = get_comment($comment->comment_parent); wp_mail($parent_comment->comment_author_email, ‘Hello’, ‘Dude you got a reply…’); } } } For … Read more

Filter custom comment type from Manage Comments & Dash Widgets

Doh, looks like the answer was staring me in the face. add_filter( ‘comments_clauses’, ‘myPlugin_exclude_custom_comments’, 10, 1); function myPlugin_exclude_custom_comments( $clauses ) { // Hide all those comments which aren’t of type system_message $clauses[‘where’] .= ‘ AND comment_type != “system_message”‘; return $clauses; } What this does is edit all comment queries to find comments that don’t have … Read more

Comments deactivated

Comments might have been closed once. If you change this option later globally it doesn’t affect existing posts when comments were turned off per post. To test if comments really work create a new post and enable the discussion meta box on that screen: If you can comment while all plugins are disabled and the … Read more

Ajax comments not working

<div> <div class=”CommentList”></div> <form action=”” class=”commentForm”> <textarea name=”comment”></textarea> <input type=”button” value=”Comment” class=”btnComment” /> </form> </div> <div> <div class=”CommentList”></div> <form action=”” class=”commentForm”> <textarea name=”comment”></textarea> <input type=”button” value=”Comment” class=”btnComment” /> </form> </div> <script type=”text/javascript”> $(document).ready(function () { $(‘.commentForm’).each(function () { $(this).prepend(‘<div class=”comment-status”></div>’); }); $(‘.commentForm’).find(‘.btnComment:button:not(.Process)’).live(‘click’, function () { $(this).addClass(‘Process’).attr(‘disabled’, true); var commentFormObj = $(this).parents(‘form.commentForm’); commentFormObj.find(‘textarea[name=comment]’).val(”); var statusDivObj = … Read more

Loading post comments after clicking a button

You could try an easy jQuery approach of hiding the comments div and inserting a button to make it appear. Instructions: In your functions.php file of your theme, place this line of code to ensure that jQuery has been included to run the code: wp_enqueue_script(‘jquery’); Then you could add this function to place the javascript … Read more

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