Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119508

Evan Solomon on "[Plugin: oEmbed in Comments] Suggestion: Add a New Size for Embeds in Comments"

$
0
0

As a starting point, you should define a CSS rule along the lines of this:


iframe {
max-width: 100%;
}

That will limit the width, and you'll end up with embeds that fit your comment area but might look a bit off (the container might be too tall). I think there are 3 possible solutions to that part, each with downsides.

  • I include some JavaScript with the plugin that resizes embeds. Downside is that it's very likely to not work well in some combination of themes/embed sources/etc.
  • Individuals write their own JavaScript to do the resizing. Downside is that more people have to do work. On the other hand, it only has to support one theme.
  • Embeds just end up being a little too tall sometimes and that's okay.

I'm hesitant to do #1 because I think it might cause more problems than it solves. I'm also not really entertaining the idea of juggling the theme's $content_width setting because the "right" width is very hard to predict based on comment nesting.

There may be another idea I haven't thought of, but that's what I came up with so far.


Viewing all articles
Browse latest Browse all 119508

Trending Articles