Site logo

Archived topic

Editing info in author box

8 replies · Started by Christopher on March 25, 2021

Viewing posts 1–9 of 9

Hi,

I've used suggestions in previous help threads to show an author box at the end of my posts. It's pulling both the picture and the bio from Gravatar.

Basically I want to know how I can edit the bio itself instead of pulling it from Gravatar as I want to add some links to other platforms eg LinkdIn, social media handles etc at the bottom of/under the bio?

Or alternatively keep the Gravatar bio and add a line of code to include the weblinks?

I'm using both Hook & Css

Hook:

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

CSS:

.author-box {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    padding: 4%;
    margin-top: 60px;
    font-size: 0.8em;
}

.author-links a {
    font-size: 3em;
    line-height: 0.5em;
    float: right;
}

.author-box .avatar {
    width: 30px;
    border-radius: 100%;
    margin-right: 20px;
}

h5.author-title {
    margin-bottom: 0.5em;
}

Hi there,

that code gets the description from the Biography field in the Users page.
WP doesn't provide support for things like Social Links by default - so that would need to be coded in.

The best method to achieve that today is to use a plugin like Simple Author Box:

https://en-gb.wordpress.org/plugins/simple-author-box/

It provides the fields for the user links etc and outputs them as part of the author box.

Thanks

You're welcome

Sorry, follow up question!

I've used your suggestion and installed the simple author box plugin.

Under the bio/author box it shows a link to another article I've written on the site (only written 2 so far).

Is it possible to get rid of links to other articles by the same author? It doesn't seem to be a plugin option so I'm wondering if I can do it in generatepress?

Thanks

GeneratePress doesn't have any options to modify the content from Simple Author Box.

I would recommend checking with their support team first :)

Thanks; I thought it might have been auto generated by GP or easily taken out via customizer or css.

In case anyone looks in the future:

-Simple Author Box couldn't help.

-The fix was Customizer> Layout> Blog>Content > Single > Untick "Display post navigation"

Ahh sorry I misunderstood what you are referring to.

Glad you've figured out :)

This archived topic is closed to new replies.