Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using Wordpress Form Manager Plugin to design a table to display race winners for an athletic event.

<table class="fm-data">
<tbody>
<tr>
<td class="fm-item-cell-lane">7</td>
<td class="fm-item-cell-bib">124</td>
<td class="fm-item-cell-fullname">Person Two</td>
<td class="fm-item-cell-country">USA</td>
<td class="fm-item-cell-sb">11.20</td>
<td class="fm-item-cell-pb">11.03</td>
</tr>
</tbody>
</table>

I would like to use the 3-letter country code together with some CSS and or PHP to dynamically display the country flag after the 3-letter code.

For more info on the limitations and functions of the plugin: Form Manager's documentation

Any Suggestions?

share|improve this question
    
That is a lot of reading. Can you narrow the problem down some? –  s_ha_dum Jan 17 '13 at 5:17
4  
Seems to me to be a CSS problem, not a WordPress problem. Maybe better to ask on Stack Overflow. –  webaware Jan 17 '13 at 5:53
    
@s_ha_dum What I have currently is the following ` <td class="fm-item-cell-country">USA</td>` I would like to use some script to output the following where the country flag dynamically displays based on the 3-letter country code.` <td class="fm-item-cell-country">USA <img src="countryflag.gif></td>` –  user26131 Jan 17 '13 at 18:35

1 Answer 1

up vote 0 down vote accepted

many ways to do it, not best but easiest is problably javascript:

<script type="text/javascript">      
jQuery('.fm-item-cell-country:contains("USA")').addClass('americanflag');
</script>

from that you edit your css (which I guess you're more comfortable with), setting property for each class (.americanflag in that case)

Hope that help a bit

share|improve this answer
    
There seems to be an error on line 3. After replacing the line 1 typo from srcipt to script there is still the error. I've created the css and still no luck. –  user26131 Jan 17 '13 at 18:58
    
don't copy it in function, but in your header for instance, remove the line starting with // , its just a comment. Still no class added? –  daco.marseille Jan 17 '13 at 19:06
    
Did all that. Still no luck. The table is still without the class. Is there another way that you had in mind? –  user26131 Jan 17 '13 at 19:49
    
Problem solved! By using your last suggestion and replacing jQuery with $ and putting the script in my footer instead of my header, everything worked fine. Thanks for the help. Final script was: <script type="text/javascript"> $('.fm-item-cell-country:contains("USA")').addClass('usaflag'); </script> Thanks again. –  user26131 Jan 18 '13 at 0:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.