Skip to content

Instantly share code, notes, and snippets.

@roborracle
Last active February 21, 2018 04:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roborracle/3aafc6dd301827e77e18 to your computer and use it in GitHub Desktop.
Save roborracle/3aafc6dd301827e77e18 to your computer and use it in GitHub Desktop.
Using Advanced Custom Fields plugin with Font Awesome to create a simple social connections link on a WordPress site.
<div class="social">
<ul class="menu simple rdo-social">
<?php if( get_field('facebook') ): ?>
<li><a href="<?php echo the_field('facebook'); ?>"><i class="fa fa-facebook"></i></a></li>
<?php endif; ?>
<?php if( get_field('twitter') ): ?>
<li><a href="<?php echo the_field('twitter'); ?>"><i class="fa fa-twitter"></i></a></li>
<?php endif; ?>
<?php if( get_field('linkedin') ): ?>
<li><a href="<?php echo the_field('linkedin'); ?>"><i class="fa fa-linkedin"></i></a></li>
<?php endif; ?>
<?php if( get_field('instagram') ): ?>
<li><a href="<?php echo the_field('instagram'); ?>"><i class="fa fa-instagram"></i></a></li>
<?php endif; ?>
<?php if( get_field('github') ): ?>
<li><a href="<?php echo the_field('github'); ?>"><i class="fa fa-github"></i></a></li>
<?php endif; ?>
<?php if( get_field('dribbble') ): ?>
<li><a href="<?php echo the_field('dribbble'); ?>"><i class="fa fa-dribbble"></i></a></li>
<?php endif; ?>
<?php if( get_field('behance') ): ?>
<li><a href="<?php echo the_field('behance'); ?>"><i class="fa fa-behance"></i></a></li>
<?php endif; ?>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment