Embedded Post Style Customisation

After figuring out how to customise embedded posts a bit I was still annoyed by the fact that they were all bright white on my dark-themed website.

Thus i spent some more time fiddling with embedded post customisation until I figured out this:

/**
 * Customises the style/colours of embedded posts.
 */
add_action( 'embed_head', 'embed_styles' );
/**
 * Embed the plugin's custom styles.
 */
function embed_styles() {
    echo <<<CSS
<style>
  .wp-embed {
    background-color:#ccc;
	color:#444;
  }
</style>
CSS;
}

Apparently you can apply “custom styles” to embedded posts.

Leave a Reply