On this site's Music Reviews page (itself built on-the-fly by a shortcode that sorts and displays posts from a "Music Review" custom post type), most of the reviews are accompanied by YouTube video embeds from the album in question.
What I didn't realize in setting that up is that YouTube embeds use tags to embed videos, and
tags block page rendering—the page's onload property, which signals that the page is fully ready to display to the viewer and to remove the spinning "page loader" image I use on this site as pages load—does not fire until every iframe on the page has fully loaded its contents. This caused that page, which currently only has a handful of videos on it, to load very slowly. What's worse, this site's custom menus parse all page contents every time the site is updated to display for word counts, meaning including that page in the menus drastically slowed down the first load of any page of the site after I update anything as the menus are rebuilt.
So I hit upon an elegant solution. I created a shortcode as follows: [ytembed url="http://youtube.com/embedurlhere?blahblahblah"]
with optional additional parameters "width"
and "float"
to set the css width and float properties.
This shortcode creates a