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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.