# Embed Template

> Aegis provides a custom embed content template that replaces the WordPress default (wp-includes/theme-compat/embed-content.php). This template gives full structural control over how Aegis posts appear when embedded on external sites via the oEmbed protocol.

## Enhancements Over the Default

The custom embed template (`embed-content.php` at the theme root) provides the following improvements over the WordPress default:

![An Aegis post embed card, as shown when the post is embedded in another WordPress site, with the featured image, title, excerpt, and site name.](https://www.atmostfear-entertainment.com/wp-content/uploads/2026/11/embed.png)

*How an Aegis post looks when embedded elsewhere.*

- **Featured image** — Always renders the featured image in a rectangular (above-title) layout.
- **Article schema.org** — Adds structured data in JSON-LD format for improved SEO and rich previews.
- **Reordered content** — Uses a logical content order: image, title, date, excerpt, terms, footer.
- **Cleaner footer** — Displays the site icon and name without the WordPress logo fallback.

## Content Order

When an Aegis post is embedded on an external site, the content is rendered in this order:

1. Featured image (linked to the post).
2. Post title (linked to the post).
3. Publication date (on single posts only).
4. Excerpt.
5. Primary taxonomy term (first category or tag).
6. Footer with site icon and site name.
7. Schema.org Article structured data (JSON-LD script).

## Schema.org Structured Data

The embed template automatically generates Article schema.org structured data with the following properties:

| Property | Value Source |
| --- | --- |
| `@type` | `Article` |
| `headline` | Post title |
| `url` | Post permalink |
| `datePublished` | Post publish date (W3C format) |
| `dateModified` | Post modified date (W3C format) |
| `author` | Post author name |
| `publisher` | Site name |
| `publisher.logo` | Site icon (512px) |
| `image` | Featured image URL |
| `description` | Post excerpt (stripped of HTML) |

## Customization

### Filters

The embed template respects the following WordPress core filters:

- `embed_thumbnail_id` — Allows modification of the featured image ID.
- `embed_thumbnail_image_size` — Controls the image size used (defaults to `aegis-embed`).

### Actions

- `embed_content` — Fires after the excerpt for additional content.
- `embed_content_meta` — Fires inside the footer for additional meta content.

## File Location

The embed template file is located at the theme root:

```
aegis/embed-content.php
```

WordPress automatically uses this file when it detects an embed content template in the active theme.

oEmbed card styling lives in the framework:

```
vendor/aegis/framework/public/css/elements/oembed.css
```

It loads on `enqueue_embed_scripts` (handle `aegis-oembed`) alongside WordPress core `wp-embed-template` styles.

## Next Steps

- [Performance](https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/performance/) — Learn about other performance features.
- [Hooks and Filters](https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/hooks-and-filters/) — Available hooks and filters.
- [Accessibility](https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/accessibility/) — Accessibility considerations for embeds.

---

Source: https://www.atmostfear-entertainment.com/docs/aegis/themes/theme/embed-template/ · Updated 2026-11-24
