Archive for November, 2011

A Letter to My Congressman, Todd Akin, Regarding SOPA

Nov 29 2011 Published by under Politics

Today, I took a moment to read up on the Stop Online Piracy Act and was duly horrified, to the point that I actually wrote my Congressman, Todd Akin. The text of this message appears below.

Congressman Akin,

I am writing you today regarding H.R.3261 AKA the Stop Online Piracy Act (SOPA). I am not alone in my belief that this bill is an ill-conceived piece of litigation that threatens to cripple the internet as we know it. While combating piracy and intellectual property theft is a noble cause, this methods afforded by this legislation are overly broad and would put an unsustainable burden on the individuals and companies that have made the internet what it is today.

As a professional who makes a living on the web, this bill would issue a ripple effect that would threaten my livelihood as well as the livelihoods of thousands of your constituents. I urge you to first read up on the finer points of this legislation (SOPA: Hollywood Finally Gets A Chance to Break the Internet), and then lead the charge against this big-government, lobbyist-funded, job-killing mess of a bill.

Yours truly,

Bob Sherron
Ballwin, MO

No responses yet

Removing the Height From WordPress Embeds

Nov 02 2011 Published by under Programming,WordPress

A while back I switched the theme for my other WordPress blog, Cracker and Cheese, to the swanky new Twenty Eleven theme. It’s a great theme, but I ran into an issue with my embeds. See, almost all the photos posted on that blog in the last year or so are oEmbeds from our Flickr account. Flickr delivers the properly sized image for embedding based on the size you choose in the Settings > Media admin screen.

The issue I was running into was that the file delivered by Flickr was less wide than my content area and if I went to a larger size, the height parameter would stretch the image vertically. What to do?

After some Googling that led me to a post from my good friend and cohort Joe Pahl, I decided that what I really wanted to do was remove the height attribute from embedded elements, but only the ones coming from Flickr. Since the max-width is handled by WordPress, I figure this is a low risk maneuver, but it’s not for everyone. If you decide to do it, here’s some code to help:

function strip_height_from_embeds($content) {
    if (false !== strpos($content,"flickr")) {
        $content = preg_replace("/height=\"(\d*)\"/","",$content);
    }  
    return $content;
}

add_filter('embed_oembed_html','strip_height_from_embeds');

2 responses so far