Advertisement
Guest User

Author box

a guest
Jan 8th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. // Custom author box
  2. add_action( 'generate_before_comments_container', 'gp_custom_author_box', 10);
  3. function gp_custom_author_box() {
  4.  ?>
  5. <div class="author-box">
  6.     <?php
  7.    
  8.     global $post;
  9.    
  10.     $author_id = $post->post_author;
  11.    
  12.     ?>
  13.    
  14.     <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' )); ?></div>
  15.  
  16.         <h5 class="author-title"><?php printf( esc_attr__( 'About %s', 'the author' ), get_the_author_meta( 'display_name') );?></h5>
  17.    
  18.                 <div class="author-summary">
  19.    
  20.         <p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
  21.  
  22.         <div class="author-links">
  23.  
  24.             <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more">
  25.                 ...
  26.             </a>
  27.  
  28.         </div>
  29.  
  30.     </div>
  31.  
  32. </div>
  33. <?php }
  34.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement