Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.77 KB | None | 0 0
  1. <div class="author-box">
  2. <div class="author-image">
  3. <img src="http://blog.blogeto.com/html/images/author_profile.png" alt="">
  4. </div>
  5. <div class="author-description">
  6. <h2>
  7. <!-- AUTHORS NAME --> <?php the_author(); ?>
  8. <!-- <a href="<?php get_author_posts_url(); ?>"><?php the_author() ?></a> -->
  9. <a href=""><i class="fa fa-home" aria-hidden="true"></i></a>
  10. <a href=""><i class="fa fa-home" aria-hidden="true"></i></a>
  11. <a href=""><i class="fa fa-facebook" aria-hidden="true"></i></a>
  12. <a href=""><i class="fa fa-twitter" aria-hidden="true"></i></a>
  13. <a href=""><i class="fa fa-linkedin" aria-hidden="true"></i></a>
  14. <a href=""><i class="fa fa-youtube" aria-hidden="true"></i></a>
  15. </h2>
  16. <p> Lorem Ipsum is simply dummy text.<a href="#">Read More</a> </p>
  17. </div>
  18. <div class="author-category">
  19. <ul>
  20. <li><a href="">CATEGORY 1</a></li>
  21. <li><a href="">CATEGORY 2</a></li>
  22. <li><a href="">CATEGORY 3</a></li>
  23. <li><a href="">CATEGORY 4</a></li>
  24. <li><a href="">CATEGORY 5</a></li>
  25. </ul>
  26. </div>
  27. </div>
  28.  
  29. // Add user contact methods
  30. add_filter( 'user_contactmethods','wpse_user_contactmethods', 10, 1 );
  31. function wpse_user_contactmethods( $contact_methods ) {
  32. $contact_methods['facebook'] = __( 'Facebook URL', 'text_domain' );
  33. $contact_methods['twitter'] = __( 'Twitter URL', 'text_domain' );
  34. $contact_methods['linkedin'] = __( 'LinkedIn URL', 'text_domain' );
  35. $contact_methods['youtube'] = __( 'YouTube URL', 'text_domain' );
  36.  
  37. return $contact_methods;
  38. }
  39.  
  40. <div class="author-box">
  41. <div class="author-image">
  42. <img src="http://blog.blogeto.com/html/images/author_profile.png" alt="">
  43. </div>
  44.  
  45. <div class="author-description">
  46. <h2>
  47. <!-- AUTHORS NAME --> <?php the_author(); ?>
  48. <!-- <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_author() ?></a> -->
  49. <?php
  50. // Get the id of the post's author.
  51. $author_id = get_the_author_meta( 'ID' );
  52.  
  53. // Get WP_User object for the author.
  54. $author_userdata = get_userdata( $author_id );
  55.  
  56. // Get the author's website. It's stored in the wp_users table in the user_url field.
  57. $author_website = $author_userdata->data->user_url;
  58.  
  59. // Get the rest of the author links. These are stored in the
  60. // wp_usermeta table by the key assigned in wpse_user_contactmethods()
  61. $author_facebook = get_the_author_meta( 'facebook', $author_id );
  62. $author_twitter = get_the_author_meta( 'twitter', $author_id );
  63. $author_linkedin = get_the_author_meta( 'linkedin', $author_id );
  64. $author_youtube = get_the_author_meta( 'youtube', $author_id );
  65.  
  66. // Output the user's social links if they have values.
  67. if ( $author_website ) {
  68. printf( '<a href="%s"><i class="fa fa-home" aria-hidden="true"></i></a>',
  69. esc_url( $author_website )
  70. );
  71. }
  72.  
  73. if ( $author_facebook ) {
  74. printf( '<a href="%s"><i class="fa fa-facebook" aria-hidden="true"></i></a>',
  75. esc_url( $author_facebook )
  76. );
  77. }
  78.  
  79. if ( $author_twitter ) {
  80. printf( '<a href="%s"><i class="fa fa-twitter" aria-hidden="true"></i></a>',
  81. esc_url( $author_twitter )
  82. );
  83. }
  84.  
  85. if ( $author_linkedin ) {
  86. printf( '<a href="%s"><i class="fa fa-linkedin" aria-hidden="true"></i></a>',
  87. esc_url( $author_linkedin )
  88. );
  89. }
  90.  
  91. if ( $author_youtube ) {
  92. printf( '<a href="%s"><i class="fa fa-youtube" aria-hidden="true"></i></a>',
  93. esc_url( $author_youtube )
  94. );
  95. }
  96. ?>
  97. </h2>
  98. <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.Lorem Ipsum is simply dummy text. <a href="#">Read More</a> </p>
  99. </div>
  100. <div class="author-category">
  101. <ul>
  102. <li><a href="">CATEGORY 1</a></li>
  103. <li><a href="">CATEGORY 2</a></li>
  104. <li><a href="">CATEGORY 3</a></li>
  105. <li><a href="">CATEGORY 4</a></li>
  106. <li><a href="">CATEGORY 5</a></li>
  107. </ul>
  108. </div>
  109. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement