<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged different</title>
<link>https://www.question2answer.org/qa/tag/different</link>
<description>Powered by Question2Answer</description>
<item>
<title>Different background colors for 0 answers and 1,2,3, ... answers</title>
<link>https://www.question2answer.org/qa/6754/different-background-colors-for-0-answers-and-1-2-3-answers</link>
<description>You might want to give the span with class qa-a-count which indicates the number of answers for a question a different background.&lt;br /&gt;
&lt;br /&gt;
For example, a red background if the number is 0 and a green background if the number is 1, 2, or more.&lt;br /&gt;
&lt;br /&gt;
You can achieve this by extending your qa-theme.php file with:&lt;br /&gt;
&lt;br /&gt;
_________________________________&lt;br /&gt;
&lt;br /&gt;
function a_count($post) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ($post['answers_raw'] &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;output_split(@$post['answers'], 'qa-a-count-multiple', 'SPAN', 'SPAN',&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@$post['answer_selected'] ? 'qa-a-count-selected' : null);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$this-&amp;gt;output_split(@$post['answers'], 'qa-a-count', 'SPAN', 'SPAN',&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@$post['answer_selected'] ? 'qa-a-count-selected' : null);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
_________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Now search for .qa-a-count in your css file and add background: red to it.&lt;br /&gt;
&lt;br /&gt;
Also add the class .qa-a-count-multiple and copy the contents of .qa-a-count to it, except for the background-color, this has to be green.&lt;br /&gt;
&lt;br /&gt;
You might also have to add a .qa-a-count-multiple-data and qa-a-count-multipe-pad with the contents of qa-a-count-data and qa-a-count-data.</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/6754/different-background-colors-for-0-answers-and-1-2-3-answers</guid>
<pubDate>Sat, 28 May 2011 17:07:22 +0000</pubDate>
</item>
</channel>
</rss>