Advertisement
yakusa47

page-author-box.php

Jul 1st, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.16 KB | None | 0 0
  1. <?php
  2.  
  3. /*  ----------------------------------------------------------------------------
  4.     The author box - used only on the author.php template ( ! this is not the same box as the one used in the single post template ! )
  5. * /public_html/wp-content/themes/newspaper/parts/page-author-box.php -> https://pastebin.com/jKdUuxZ2
  6. * /public_html/wp-content/themes/newspaper/author.php -> https://pastebin.com/mD069dDP
  7. * /public_html/wp-content/themes/newspaper/loop-single-1.php -> https://pastebin.com/sZvfpeXs
  8.  */
  9.  
  10. global $part_cur_auth_obj;
  11.  
  12.  
  13.  
  14. ?>
  15. <div class="author-box-wrap td-author-page">
  16.  
  17.     <?php  echo get_avatar($part_cur_auth_obj->user_email, '96'); ?>
  18.     <div class="desc">
  19.  
  20.  
  21.         <div class="td-author-counters">
  22.             <span class="td-author-post-count">
  23.                 <?php echo count_user_posts($part_cur_auth_obj->ID). ' '  . __td('POSTS', TD_THEME_NAME);?>
  24.             </span>
  25.  
  26.             <span class="td-author-comments-count">
  27.                 <?php
  28.                 $comment_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) AS total FROM $wpdb->comments WHERE comment_approved = 1 AND user_id = %d", $part_cur_auth_obj->ID));
  29.  
  30.                 echo $comment_count . ' '  . __td('COMMENTS', TD_THEME_NAME);
  31.                 ?>
  32.             </span>
  33.  
  34.         </div>
  35.  
  36.         <?php
  37.         if (!empty($part_cur_auth_obj->user_url)) {
  38.             echo '<div class="td-author-url"><a href="' . esc_url($part_cur_auth_obj->user_url) . '">' . esc_url($part_cur_auth_obj->user_url) . '</a></div>';
  39.         }
  40.  
  41.         echo $part_cur_auth_obj->description;
  42.  
  43.         ?>
  44.  
  45.  
  46.  
  47.         <div class="td-author-social">
  48.             <?php
  49.  
  50.             foreach (td_social_icons::$td_social_icons_array as $td_social_id => $td_social_name) {
  51.                 //echo get_the_author_meta($td_social_id) . '<br>';
  52.                 $authorMeta = get_the_author_meta($td_social_id, $part_cur_auth_obj->ID);
  53.                 if (!empty($authorMeta)) {
  54.                     echo td_social_icons::get_icon($authorMeta, $td_social_id, true );
  55.                 }
  56.             }
  57.             ?>
  58.         </div>
  59.     </div>
  60.  
  61.     <div class="clearfix"></div>
  62. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement