# Guest bio box for Ghost

HTML card + code injection · Works with any Ghost theme · No JavaScript

Source: https://brightthemes.com/snippets/guest-bio

A short box for the end of a guest post, with the guest's photo, name, role, a few lines about them and their links.

## When to use it
- A one-off guest post from someone who won't write for you again and needs no account.
- An interview or Q&A, to introduce the person you talked to once readers have met them.
- A cross-post from another newsletter, crediting the original writer and linking back to their publication.
When not to: For a regular contributor, add them as a Contributor in **Settings › Staff**, so the theme shows their name and author page.

## The code

HTML:

```html
<aside class="bt-guest-bio" aria-label="About the guest author">
  <span class="bt-guest-bio-photo" aria-hidden="true">MR</span>
  <div class="bt-guest-bio-body">
    <h2 class="bt-guest-bio-name"><span class="bt-guest-bio-label">Guest author</span> Maya Ross</h2>
    <p class="bt-guest-bio-role">Editor of a weekly newsletter on small-town food</p>
    <p class="bt-guest-bio-text">Maya moved her newsletter to Ghost in 2024 and now publishes every Thursday to a few thousand readers, a third of them paying members. She writes about what running a publication on her own has taught her.</p>
    <p class="bt-guest-bio-links"><a href="https://example.com">Website</a> <a href="https://example.com/newsletter">Newsletter</a></p>
  </div>
</aside>
```

CSS:

```css
.bt-guest-bio {
  --bt-guest-bio-accent: var(--ghost-accent-color, #4433ff);
  --bt-guest-bio-tint: 5%;
  --bt-guest-bio-photo-size: 4.5em;
  --bt-guest-bio-radius: 8px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1em 1.25em;
  margin: 0 0 1.5em;
  padding: 1.5em;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: var(--bt-guest-bio-radius);
  background-color: color-mix(in srgb, var(--bt-guest-bio-accent) var(--bt-guest-bio-tint), transparent);
  color: inherit;
  line-height: 1.55;
}

.bt-guest-bio > .bt-guest-bio-photo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--bt-guest-bio-photo-size);
  height: var(--bt-guest-bio-photo-size);
  margin: 0;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--bt-guest-bio-accent) 16%, transparent);
  object-fit: cover;
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.bt-guest-bio > .bt-guest-bio-body {
  flex: 1 1 16em;
  min-width: 0;
}

.bt-guest-bio .bt-guest-bio-name {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: inherit;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  color: inherit;
}

.bt-guest-bio .bt-guest-bio-label {
  display: block;
  margin: 0 0 0.25em;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.bt-guest-bio .bt-guest-bio-role {
  margin: 0.15em 0 0;
  font-size: 0.9em;
  opacity: 0.8;
}

.bt-guest-bio .bt-guest-bio-text {
  margin: 0.75em 0 0;
}

.bt-guest-bio .bt-guest-bio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.25em;
  margin: 0.75em 0 0;
  font-weight: 600;
}

.bt-guest-bio .bt-guest-bio-links a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--bt-guest-bio-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
```

## Add it to your site

1. Copy the **CSS** and paste it in **Settings › Advanced › Code injection › Site header**, between `<style>` and `</style>`. Once per site.
2. In a post, add an **HTML card** (type `/html`) and paste the **HTML**.
3. Change the example text to your own, then publish or update the post.

Tip: save the card as a Ghost snippet to add it to any post from the card menu: how Ghost snippets work, https://brightthemes.com/blog/ghost-snippets

## How it works

The box is an `<aside>` named "About the guest author", so screen readers announce it as a separate part of the page, and its heading reads "Guest author Maya Ross". It goes at the end of the post, after the last paragraph. The name, the role, the text and the links all use your theme's font and text color; only a light tint, the circle and the link underlines use the accent color, so the box works on light and dark themes.

The example shows the guest's initials in a circle, which needs no image. To use a real photo, upload it to an Image card in any draft, copy its address, and replace the `<span class="bt-guest-bio-photo" …>MR</span>` line with `<img class="bt-guest-bio-photo" src="https://your-site.com/content/images/photo.jpg" alt="" width="96" height="96">`. The `alt` stays empty because the name is right next to the photo. Change the links to the guest's own pages, or remove the line if there are none.

Ghost can also credit a guest as the post's author: add them as a Contributor in **Settings › Staff** and choose them in the post settings, and the theme shows their name and profile. Use this box when the guest shouldn't have an account on your site, or when you want the bio inside the post. Save one copy as a Ghost snippet and change the details for each guest: see [how to use Ghost snippets](https://brightthemes.com/blog/ghost-snippets). The CSS from code injection doesn't reach emails, so in a newsletter the box shows as plain text.

## Customize
| Variable | Default | What it changes |
|---|---|---|
| `--bt-guest-bio-accent` | `var(--ghost-accent-color, #4433ff)` | The color of the background tint, the initials circle and the link underlines. Defaults to your site's accent color. |
| `--bt-guest-bio-tint` | `5%` | How much of the accent color tints the background. 0% for no background. |
| `--bt-guest-bio-photo-size` | `4.5em` | The width and height of the photo or initials circle. |
| `--bt-guest-bio-radius` | `8px` | The corner radius of the box. |

It works with every Ghost theme, including ours (https://brightthemes.com/themes). Something not right? Ask support: https://brightthemes.com/support
