Support

Account

Home Forums Feature Requests File field type: Option to return SVG as code Reply To: File field type: Option to return SVG as code

  • Hello,
    thanks for your snippets, but none of your solutions work for me.

    <?php $test = get_field('logo', 'option'); ?>
    <a href="<?php the_field('link'); ?>" target="_blank">
    <?php echo file_get_contents( $test ); ?>
    </a>

    I’ve tested image field with object array or URL but nothing appears in my a link-tag.
    The fields are correct, because everything works fine for a (simple) display of img logos (example below).

    <?php $test = get_field('logo'); ?>
    <a href="<?php the_field('link'); ?>" target="_blank">
    <img src="<?php echo $test['url']; ?>" alt="<?php echo $test['alt']; ?>" />
    </a>

    But I want to use inline SVGs to animate the hovers in css.
    Would someone be able to help me please?
    I have been looking for solutions for several days.
    Thank you.