Archived topic

Author Box

9 replies · Started by Sagar on May 9, 2020

Viewing posts 1–10 of 10

Hello there! Is there any solution to add the author box at the bottom of every post without adding a plugin?

If yes, please tell me the full process, how can I add that on my site.

I have installed the security plugin on my site and that plugin is causing the isssue to excute the php.
Error I get:
Unable to execute PHP as DISALLOW_FILE_EDIT is defined.

Thanks, David. It worked perfectly fine. Could you please customize the PHP code? I want to set the link in the author name with the author page URL.

try this instead it will add the link to the Author Title:

<div class="author-box">
    
    <?php global $post; ?>
	
    <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' )); ?></div>
    
    <h5 class="author-title"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more"><?php printf( esc_attr__( 'About %s', 'the author' ), get_the_author_meta( 'display_name') );?></a></h5>
    
    <div class="author-summary">
	
        <p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
 
    </div>
 
</div>

Would you mind on writing like this Written By "Author Name" on " Published Date"?

Hi there,

Try this:

<div class="author-box">
    
    <?php global $post; ?>
	
    <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' )); ?></div>
    
    <h5 class="author-title">Written by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more"><?php echo get_the_author_meta( 'display_name'); ?></a> on <?php echo generate_do_post_meta_item( 'date' ); ?></h5>
    
    <div class="author-summary">
	
        <p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
 
    </div>
 
</div>

Thank you Tom :)

No problem :)

This archived topic is closed to new replies.