Advertisement
afsarwebdev

wp-If social link set from backend then social icon show or

Aug 3rd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. //If social link set from backend then social icon show else not
  2. <ul>
  3. <?php
  4. $socialIcons=['icofont-social-facebook'=>'team_member_fb_link','icofont-social-twitter'=>'team_member_twitter_link','icofont-brand-linkedin'=>'team_member_linkedin_link','icofont-social-google-plus'=>'team_member_googleplus_link'];
  5. foreach ($socialIcons as $key => $value) {
  6. $check=get_post_meta(get_the_ID(), $value, true);
  7. if ($check !="") {
  8. ?>
  9. <li><a href="<?php echo get_post_meta(get_the_ID(), $value, true); ?>"><i class="icofont <?php echo $key;?>"></i></a></li>
  10. <?php
  11. }
  12. }
  13. ?>
  14. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement