ACF Social Links

<?php if(get_field('facebook', 'option')){?> <a href="<?php the_field('facebook','option');?>"> <i class="fa fa-facebook"></i> </a> <?php } if(get_field('pinterest','option')){?> <a href="<?php the_field('pinterest','option');?>"> <i class="fa fa-pinterest"></i> </a> <?php } if(get_field('linkedin','option')){?> <a href="<?php the_field('linkedin','option');?>"> <i class="fa fa-linkedin"></i> </a> <?php } if(get_field('twitter','option')){?> <a href="<?php the_field('twitter','option');?>"> <i class="fa fa-twitter"></i> </a> <?php } if(get_field('youtube','option')){?> <a href="<?php the_field('youtube','option');?>"> <i class="fa fa-youtube"></i> </a> <?php } ?>
Requires ACF 5.x+

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.