Support

Account

Home Forums General Issues Radio Button image label

Solved

Radio Button image label

  • I’m looking to create a radio box field for layout, however I would love to replace the text with the an image but have had little luck.

  • Hi @gnuandyou,

    Have you tried using the acf/load_field filter to alter the choices for the radio button? Its pretty simple, try this:

    add_filter('acf/load_field/name=my_radio)button', 'my_acf_load_field');
    
    function my_acf_load_field( $field ) {
    
        $field['choices'] = array(
            'image_1' => '<img src=".../image_1.jpg" alt="image" />',
            'image_2' => '<img src=".../image_2.jpg" alt="image" />'
            ...
        );
    
        return $field;
    }

    For more information about this, have a look at: acf/load_field

  • Ah my mistake for some reason I thought you couldn’t include html as part of the editor. Yea this works great Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.