Hi all,
I wonder if anyone know how to make the following code into a function? The reason why is at the moment it kinda breaks my HTML as it is in a <li> tag.
The pupose of the code is to alternate color unless something is posted by me. Then a custom color is used. But I don't want it to affect the alternating colors.
So say it went: white, blue, white, blue.
And my color is orange, I want it to go:
white, blue, orange, white, blue.
Not...
Instead of:
white, blue, orange, blue, white.
I want to be able to call it like this:
<?php myfunction(); ?>
Thanks for any help, oh and I hope what I have said makes sense? lol...
Steve
<?php
$your_url = 'http://www.stevepsharpe.co.uk'; // Write your url here
$your_name = 'Steve Sharpe'; // Write your name here
$your_email = 'me@stevepsharpe.co.uk'; // Write your email here
$the_name = apply_filters('comment_author', $comment->comment_author);
$the_url = apply_filters('comment_url', $comment->comment_author_url);
$the_email = $comment->comment_author_email;
if (($the_name == $your_name) && ($the_url == $your_url) && ($the_email == $your_email)) {
echo "class='mycomments'"; // The class to be defined in your stylesheet
}else{?>
class="<?=($i%2)?"color1":"color2";$i++;?>"
<?php } ?>>