developer-blog-content icon indicating copy to clipboard operation
developer-blog-content copied to clipboard

How to customize WordPress embeds to match your theme

Open bph opened this issue 1 year ago • 0 comments

Discussed in https://github.com/WordPress/developer-blog-content/discussions/297

Originally posted by justintadlock August 28, 2024 WordPress embeds let any WP site's posts be embed anywhere.

image

But did you know that you can create a custom embed.php template to customize it? There's no block template equivalent, but there are many hooks that you can filter and even load custom CSS to to make it match your theme.

image

You can even customize the embed code panel:

image

This tutorial would explore all the various tips, tricks, and techniques to completely customizing a site's embedded posts so that they match their brand/theme when shared on third-party sites.

A lot of the techniques that would be covered (particularly PHP) are covered in this file:

  • https://github.com/x3p0-dev/x3p0-ideas/blob/869d801bd7e11dccffb4b344b174c7b52ac89e52/src/Embeds.php

bph avatar Sep 10 '24 13:09 bph