I used ternary operators to have multiple backgrounds with listed item.
But now I am getting this error, Error message
Notice: Undefined variable: x in include() (line 45 of /home/content/67/11380467/html/beta/sites/all/modules/custom/blogs.tpl.php).
<?php
$x++;
$class = ($x%2 == 0)? 'second': '';
print $class;
?>
Can you please help me understand what went wrong here and help me fix it.
Thanks!
$x=0before incrementinclude()statement here. can you show more context which includes theinclude()call?