views:

17

answers:

1

I'm trying to include something at the end of the comments array for a WordPress plugin.

I currently have add_filter('comments_array', 'my_function'), where my_function($comments='') is something along the lines of:

my_function($comments='') {
  echo 'something';

  return $comments;
}

I obviously can't return the comments first, and echoing them doesn't work because $comments is a multi-dimensional array. Is there some way I can print the WordPress comments and then append something to them?

Thanks.

+1  A: 

You want to add something that looks like a comment or add arbitrary html under each comment block?

Can you add to the page template(s) what you want to appear under the comments block? I.e.,

<?php comments_template(); ?>

html or php here

<?php endwhile; else: ?>
songdogtech
I could do that quite easily, yes, but I'd like to be able to do this all my my plugin's PHP file so I don't need users to edit their theme directly.Do you know if that's possible? If not, I'll just edit the theme.
thinkswan