user2551137
user2551137

Reputation: 31

How to filter comments by type?

I want to filter comments type because I use Sensei of WooThemes and this plugin logs the activity in comments, and the Sensei comments appear with regular comments.

I put the argument 'type' in get_comments without success.

Upvotes: 0

Views: 564

Answers (2)

Kamel
Kamel

Reputation: 1

if you are using get_comments() then you can simply use $comment->comment_type to check for only empty types (normal comments)

Upvotes: 0

jharrvis
jharrvis

Reputation: 335

you can use wp_list_comments instead of get_comments read the documentation : http://codex.wordpress.org/Function_Reference/wp_list_comments

filter comment by type "comment", the default is all :

<?php wp_list_comments( array( 'type' => 'comment', 'callback' => 'my_theme_comments', 'style' => 'ol' ) ); ?>

it's work for me, and hope this help someone.

Upvotes: 1

Related Questions