Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Radio button values into icons

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #160990
    Ailsa_C
    Participant

    Hi,
    I have an event timetable. In the back end you can specify whether the event type is a ‘Presentation, Workshop or Coffee Break. I want each of these in the front end to display as icons not words.
    This is the basic code I have for the backend.

    <?php the_sub_field('event_type'); ?>

    Does anyone know what I need to add to convert the words into icons? (hope this isn’t confusing!). Many thanks.

    #161025
    TheDoc
    Moderator

    You could do something like this to convert the types into class names: http://stackoverflow.com/questions/11330480/strip-php-variable-replace-white-spaces-with-dashes

    Then just go something like:

    <span class="icon <?php echo $eventType; ?>"></span>
    
    #161026
    Ailsa_C
    Participant

    Thanks TheDoc – I’ll give that a go!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.