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

<table class="fm-data">
<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>

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?

  • 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

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

<script type="text/javascript">      

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

  • 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? 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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