Wordpress author pages with custom fields in profile


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <div id="socialntwrk">
  2. <?php if(get_the_author_meta('twitter', $curauth->ID) || get_the_author_meta('facebook', $curauth->ID) || get_the_author_meta('linkedin', $curauth->ID) || get_the_author_meta('digg', $curauth->ID) || get_the_author_meta('flickr', $curauth->ID)): ?>
  3. <ul>
  4. <?php if(get_the_author_meta('twitter', $curauth->ID)): ?>
  5. <li><a href='http://twitter.com/<?php the_author_meta('twitter', $curauth->ID); ?>'><img title="Follow me" src="http://sharecommons.com/images/twitter.png" alt="Twitter" /></a></li>
  6. <?php endif; ?>
  7. <?php if(get_the_author_meta('facebook', $curauth->ID)): ?>
  8. <li><a href='http://www.facebook.com/<?php the_author_meta('facebook', $curauth->ID); ?>'><img title="Become a fan" src="http://sharecommons.com/images/facebook.png" alt="Facebook" /></a></li>
  9. <?php endif; ?>
  10. <?php if(get_the_author_meta('linkedin', $curauth->ID)): ?>
  11. <li><a href='http://www.linkedin.com/in/<?php the_author_meta('linkedin', $curauth->ID); ?>'><img title="Connect with me" src="http://sharecommons.com/images/linkedin.png" alt="Linkedin" /></a></li>
  12. <?php endif; ?>
  13. <?php if(get_the_author_meta('digg', $curauth->ID)): ?>
  14. <li><a href='http://digg.com/users/<?php the_author_meta('digg', $curauth->ID); ?>'><img title="Digg me" src="http://sharecommons.com/images/digg.png" alt="Digg" /></a></li>
  15. <?php endif; ?>
  16. <?php if(get_the_author_meta('flickr', $curauth->ID)): ?>
  17. <li><a href='http://www.flickr.com/photos/<?php the_author_meta('flickr', $curauth->ID); ?>/'><img title="My Flickr" src="http://sharecommons.com/images/flickr.png" alt="Flickr" /></a></li>
  18. <?php endif; ?>
  19. </ul>
  20. <?php endif; ?>
  21.  
  22. <?php endforeach; endif; ?>
  23. </div>

URL: http://wordpress.org/support/topic/templating-authorphp

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.