Site logo

Archived topic

Author box in page

4 replies · Started by Sagar on May 11, 2020

Viewing posts 1–5 of 5

Hello there !

Could you please provide the php script to show author box on both posts and pages?

I have already added this script provided by Tom:

<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>

Hi there,

How are you adding the author box at the moment? Elements? If so, have you tried expanding the Display Rules to include pages?

Yeah. I tried the display rule option, but that worked only on post.
Display Rules

It's now working after changing the hook option from after_entry_content to after_content. But, there may be a problem with after_entry_content.

The after_entry_content hook is only present on the single post.
Glad to hear you got it resolved.

This archived topic is closed to new replies.