Take a look at the arguments you’re passing to get_comments() and compare them to the documentation on the WordPress Codex.
Your example –
$args = array(
'include' => $postids,
'meta_query' => array(
array(
'key' => 'viewed_status',
'value' => 'unseen'
)
),
'count' => true
);
The codex example –
$defaults = array(
'author_email' => '',
'ID' => '',
'karma' => '',
'number' => '',
'offset' => '',
'orderby' => '',
'order' => 'DESC',
'parent' => '',
'post_id' => '',
'post_author' => '',
'post_name' => '',
'post_parent' => '',
'post_status' => '',
'post_type' => '',
'status' => '',
'type' => '',
'user_id' => '',
'search' => '',
'count' => false
);
- You’re passing a multidimensional array when the docs clearly indicate a single dimensional array.
- You’re also passing an array of ‘Post IDs’ when the docs clearly indicate that an integer is expected.