Author Bio & Image Size

Posted in: Newspaper
Post count: 66

I am looking to create an Authors page using built-in Authors Box widget. Please guide me regarding how to
1. How to display author Bio alongside Avatar
2. How to increase the Avatar size from current 96px to somewhat 250px or so
3. Can we display two different image sizes on two different author boxes?

I have seen similar questions asked before but Pastebin URL is not working on my end.

Thanks
Azhar Nadeem

Post count: 22421

Hi,

You can follow this tutorial: https://forum.tagdiv.com/author-card/
or You can create a page to display all your authors using Authors Box block. It will display all your authors(name, photo and posts and comments counter) – http://screencast.com/t/l1baxeL773s2
If you need also author bio information, you will have to add this code in td_block_authors.php file – http://screencast.com/t/LQFrzsG1J
code:

$buffy .= '<div class="td-authors-description">';
                $buffy .= '<p>' . get_the_author_meta( "description", $td_author->ID ) . '</p>';
                $buffy .= '</div>';

And add the following css in Theme Panel > Custom Css – http://screencast.com/t/2esvImmE

.td_top_authors div.item-details {
height: auto;
}

You can increase the image size from 96px using this custom css ():

.td_top_authors .td_mod_wrap {
    min-height: 256px;
padding-left: 185px;}
.td_top_authors img{
max-width:100%;
width:256px;
}

Unfortunately it is not easy to target just a particular author box.

Thanks!

Post count: 1

Hi Bogdan,

By adding the code for displaying author bio in the Authors Box block I guess this will also show up in the sidebar instances of this block and this will make it look too busy.

I’m also looking to add a list of authors, their bio, avatar, number of posts, etc into an “About us” page. I saw in a post almost a year ago (https://forum.tagdiv.com/topic/authors-box-doesnt-show-bio/) that this was part of your future release plans but I’m not sure if you’ve managed to do it. Any advice?

Thanks!

Post count: 22421

Hello,
The author page can be created following this tutorial: https://forum.tagdiv.com/author-card/
example: http://demo.tagdiv.com/newspaper/author/admin/
If you plan on using the css code above only for a particular page you can add the page it as a class in front of the code so it will apply only to the specific page. You can see the page id like so:

.page-id-148 .td_top_authors .td_mod_wrap {
min-height: 256px;
padding-left: 185px;}
.td_top_authors img{
max-width:100%;
width:256px;
}

I hope this helps.
Thank you!

Post count: 33

Hi,
As you can see at the end of this page, the height of each author box is fixed, so, if there’s more than 2 lines, it doesn’t work anymore :

http://la-rem.eu/les-auteurs/

Look at the line : Boris Barraud

Could you help me please ?

Thk you

JA_FS

Post count: 22421

Hi,

You can use this css to fix the fixed height and have the author boxes display properly:
.td_top_authors .item-details{
height:100%!important;
}
.td_top_authors .td_mod_wrap{
padding-top:2px!important;
padding-bottom:2px!important;
}
.td-authors-description p{
margin-bottom: 5px!important;
}

I also reduced the margins and padding a bit.

Thank you!

Post count: 33

thank you,
it works perfectly ! : http://la-rem.eu/les-auteurs-2/

as you’ve seen, we have 46 authors, that’s a lot ! do you have a tip to organise the page in 2 columns ? For example, on the first column, author from letter A to L and second column from M to Z. It will be so much nicer than this one big page that you have to scroll till the end. again, thank you !

Post count: 22421

Hi,
You can use visual composer and the author box settings to do it. Simply split the row in 2 columns and add 2 author boxes like so: http://screencast.com/t/dPymvqIZ
You will need the author ID’s for the settings.
Hope this helps.
Thanks

Post count: 33

good idea, thank you
http://la-rem.eu/les-auteurs-2/

Post count: 33

Hi,
I have a last question ; as you can see on this page, authors are sorted with their first name, which is a little bit weird. Is there a way to sort this list with their last name, because the entry exists in admin
thank you for your response
Jack

Post count: 22421

Hi,
The sorting was added only on the firstname. The only easy way I see this is if you edit each author and switch their names (first and last) so the names in the list will be inverted. Creating a new sorting option for the author will be more difficult.
Hope this helps.
Thanks.

Post count: 33

Hi,
Thks ; actually, if I switch first and last name, the signature on each article and on the homepage will be inverted, so, it will be strange. I cannot deactivate the sorting and configure it manually ?

Post count: 22421

Hi,
Maybe you can try to edit the author block in the them files as I see that the function used accepts different parameters including first and last name: https://codex.wordpress.org/Function_Reference/the_author_meta
The parameter used by us is display_name. Try to change it here: http://screencast.com/t/t0KRpftM with one of the parameters from the codex.
Thank you!

Post count: 33

Hi,
Thank you for your response
I tried to modify “td_block_authors” and use both parameters from the codex “last_name” and “user_lastname” but none of them work.. I don’t understand why..

Post count: 22421

Hi,
I tested this again but it will only render either the first or the last name of the author. It will not keep both unfortunately. This means there is no easy way to change the order. A custom function must be created for it unfortunately and I cannot provide any easy way to do it. You will require coding knowledge to do it.
Thank you!

Post count: 33

never mind, thank you for your answser

Post count: 33

Hi,
I found a solution to customize the alphabetical sorting and I would like to share it :

in the “td_block_authors”, you have to add this line :
usort($td_authors, create_function(‘$a, $b’, ‘return strnatcasecmp($a->last_name, $b->last_name);’));

here (line 74) :

if (!empty($td_authors)) {
usort($td_authors, create_function(‘$a, $b’, ‘return strnatcasecmp($a->last_name, $b->last_name);’));
foreach ($td_authors as $td_author) {
//echo td_global::$current_author_obj->ID;
//echo $td_author->ID;
//print_r($td_author);

A question though : I added some specific CSS but I have no more description of the author after the update ; as you can see on this page : http://la-rem.eu/les-auteurs-2-2/

could you tell me what I’ve to do ?

Thks for your answer !

custom CSS I already have :

.td_top_authors .item-details{
height:100%!important;
}
.td_top_authors .td_mod_wrap{
padding-top:20px!important;
padding-bottom:20px!important;
}
.td-authors-description p{
margin-bottom: 5px!important;
}

Post count: 22421

Hi,
And if you remove the css will the description be back? Try it out and figure out exactly which part causes it.
Try to see where the description fails. For your php code or the css.
Thank you!

Post count: 33

Hi,
I remove the CSS but the description is not back
I can’t find any code about “.td-authors-description” in the php file ? is this normal ?
thks

Post count: 22421

Hi,
The description was not meant to be displayed on the author box itself, but only when a user is clicked. This is the default behavior of the theme, and if you click on the author, the description is there.
That was a customization you made based on my first reply on the top of this topic. That class was added custom, so maybe you replaced the file when you updated the theme and your customization is gone. You have to do it again.
Thank you!

Post count: 33

ok, sorry.
I did it and it works perfectly
Thank you for your patience
Have a nice day
Cheers

Viewing 21 posts - 1 through 21 (of 21 total)
The forum ‘Newspaper’ is closed to new topics and replies.