I want to add an extra classname to my
comment template (the div wrapper before the post itself) which is stated in functions.php. The classname in functions.php is an extra field in my users profile section and I want to get that string and add it as an extra classname in my comment template.
The thing I want to add:
The question is: how do I do that? If I use
$classes = 'comment-author-' . sanitize_html_class(echo $cityofuser->user_city);
in a template, it won't work. I get errors like
syntax error, unexpected 'echo'
In my register form, people can add info in a new field, stating the city they live in. I want to get this field's output, make it a new classname in the comment template and I want to change the background of the users post based on this classname. So the
custom field echo $cityofuser->user_city that I have made (in functions.php) and added to my register pages, is something I want to use in my whole site.
I want to add the new class name in here:
<div id="comment-5" class="comment byuser comment-author-admin even thread-odd thread-alt depth-1">
And after this is done, also on the posts. That must be something like
get_post_author?=cityofuser=Montreal or something, but I don't have a clue how to do that.