• Resolved Artus

    (@tintalent)


    In the user’s profile there is a dropdown list with options to choose from. Lets say the custom field name is colors with several values: red, green, blue, etc. Can I add a css class to those values. Like red_css, blue_css etc? To style accordinly like:
    .blue_css {font-size: 10px;}

    Is that even possible? Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You want to style the options in the dropdown list itself, or the output of the values that are somewhere on the public side of the website?

    Thread Starter Artus

    (@tintalent)

    The output values on the public page.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    So this would take place in the outputting process. Does this output come from your theme, or a plugin?

    Thread Starter Artus

    (@tintalent)

    It comes from a plugin (amr-users) that displays a list of users showing their selected options. I created the custom field using ACF. I need to add a pic (flag) next to the names of users’ countries. I plan to add it like: .css_country_name{background: url(image/flag.png);} Or is there a better way?

    Thread Starter Artus

    (@tintalent)

    it worked with the class.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add a css class to custom field value’ is closed to new replies.