Small Author Image on Single post when Mobile theme ON

Posted in: Newspaper
Post count: 436

Currently, my theme is customized to show a small author image below post title on every single posts on desktop as well as it’s mobile responsive version.

But when I tried to the same when “TD mobile theme” was ON. It didn’t appear. SO, I made similar changes to Mobile theme.

I edited single.php file under mobile folder of newspaper theme, and replaced :


<?php echo $td_mod_single->get_author();?>

with


	    <?php echo get_avatar(get_the_author_meta('ID', $post->post_author), 39) . $td_mod_single->get_author();?>

and then added this custom CSS code to mobile theme custom CSS setting:


.avatar-39{
float:left;width:39px;height:39px;border-radius:39px;margin:-12px 10px 5px 0;
}

The method exactly similar to what I did in case of desktop version.

But the result is this: https://i.snag.gy/XzT2YC.jpg

I am getting only top half of the author image. I tried some CSS tweaks but no successful. SO, I need your help to fix this.

Thank you.

  • This topic was modified 9 years by Nano.
Post count: 23312

Hello nano2408,

Please try to use the following code and place it in Theme panel to fix it that problem in the mobile version. Please notice that the thumb was set it to be 17 as value and that’s why you do not bring the good results in this.

.avatar-39{
float:left;width:39px;height:39px;border-radius:39px;margin:0 10px 5px 0;
}
header .td-module-meta-info{
height: 40px!important;
}

Thanks for your message!

Post count: 436

It worked. Thank you 🙂

Post count: 29

How i add link author page for author image?

Post count: 23312

Hello yerbol89,

By default, if you will click on the author image on the post you will be automatically redirected to the author page. If is not what you mean, provide more details so I will be able to provide a more accurate response.

Thanks.

Post count: 29

<?php echo get_avatar(get_the_author_meta('ID', $post->post_author), 39) . $td_mod_single->get_author();?>

Author avatar not link. Author name text link.

Post count: 23312

Hello yerbol89,

You should add a link to your avatar from where this is loaded, like this -> https://www.w3schools.com/html/html_images.asp It’s not a simple task and if you are not aware of the steps which are needed to take in this case, please consider hiring a freelancer/developer to help you because we can not provide custom work at the moment, sorry!

Thanks for the message!

Post count: 32

Hi,

How to add Small Author Image mobile theme
Please help me

Post count: 35449

Hi johnu101, unfortunately for mobile theme plugin there is no option to display the small author image, this can be add only with custom work or if you are using a responsive version with a cloud template.
Thank you!

Post count: 32

Hi Calin

where I want to add this code
<?php echo get_avatar(get_the_author_meta(‘ID’, $post->post_author), 39) . $td_mod_single->get_author();?>
I do not find a single.php file under the mobile folder of the newspaper theme

Post count: 35449

Hi,

You can set that code in this file path -> wp-content/plugins/td-composer/mobile/single.php in this way it will be apply on the single post template from mobile theme plugin.

Thank you!

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