Need help creating author bio box at end of articles

Hi there,

I’ve been on the hunt for new themes recently, but I’ve noticed that most of the themes that I am interested in don’t come with a feature that shows the author’s photo/bio in a box at the end of each post. I haven’t seen much online about how to edit themes in order to allow for this feature, so I was hoping someone here may be able to help.

Ideally, I’d like a box at the end of each post to show the author, author bio, author picture and social media links. If anyone with some more coding expertise could help with this, I’d appreciate it.

Thanks!

Any specific reason you are adding one? Do you have the rights to upload themes?

I just think it looks professional and puts my past writing experience/accolades in a more visible space. And yes, I have the rights to edit and upload themes.

1 Like

@jannis did a author box here and also showed the code and CSS they used. This can all be over the top or simple, its more in your comfort adjusting the theme files and then adding in the css needed to make them look how you want them to look.

Thats probably a good place to start to add one, always focus on basic then you can make it more detailed as you want to put the time and effort in.

1 Like

It seems that their answer may be theme-specific. I pulled up Casper, for example, and there was no content.hbs file.

You need to go to the theme post.hbs or similar if they make overrides. This will obviously change from theme to theme as there is base templates but they can be overridden with customs.

1 Like

I tried to paste their code into the theme, but upon trying to upload it I was notified there were errors. Not sure what I’m doing wrong, but it’s a bit hard to tell where to place their code in the post.hbs file because I don’t see the same code they mentioned.

No theme is 100% a match from one to the other, I’ve seen examples many times but they won’t just be plug and play into a theme in most cases unless older Casper or new with Source.

When you run themes outside the core you may need to ask the author for a more specific one if you dont want to learn handlebars in general (though it isnt complex it and css is needed to make a author box).

@Cathy_Sarisky I know you have tutorials, is there anything you know of as to tutorials on creating simple author boxes?

1 Like

If you try a bland example like from the handlebars doc what happens?

{{#primary_author}}
<div class="author">
    <a href="{{url}}">{{name}}</a>
    <span class="bio">{{bio}}</span>
</div>
{{/primary_author}}
1 Like

Using that example, the author name and bio (in simple text) showed up at the end of the article.

1 Like

So that’s a good start! You’re probably not getting a bio because you don’t have one set. You can see what’s available by opening the profile - the little person icon (or gravatar) in the lower left corner of the ghost dashboard.

1 Like

So then its more using the author criteria to find what you want and then go deeper from there. Its addicting and fun once you get into it but that shows you can get the info you want now its just finding what you need to get to fill in more.

Cheers!