[Resolved] Author Box

Home Forums Support [Resolved] Author Box

Home Forums Support Author Box

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1277416
    Sagar

    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.

    #1277495
    Suraj Katwal
    #1277523
    Sagar

    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.

    #1277645
    David
    Staff
    Customer Support

    Thanks Suraj

    You can add the PHP Snippet provided here to allow PHP execution just in the GP Hook Element:

    https://docs.generatepress.com/article/generate_hooks_execute_php/

    #1277730
    Sagar

    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.

    #1277742
    David
    Staff
    Customer Support

    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>
    #1278111
    Sagar

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

    #1278330
    Tom
    Lead Developer
    Lead Developer

    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>
    #1278620
    Sagar

    Thank you Tom ๐Ÿ™‚

    #1279396
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.