I am using the ImageScaler plugin for WordPress on a project, and I like what it does, but it adds a non-standards-compliant attribute to images, such as:
<img class="" src="http://www.example.com/imagescaler/generated-image.jpg" alt="Example" width="258" height="234" imagescaler="http://www.example.com/imagescaler/original-image.jpg" />
To strip imagescaler’s imagescaler attribute, add the following into your functions.php file:
add_filter('the_content', 'strip_imagescaler');
function strip_imagescaler($content) {
$content = preg_replace('/imagescaler="(.*?)".?/s','', $content);
return $content;
}
This is for everyone who’s been trying to find out how to get the medium image size of a post attachment in WordPress:
You’ve got to send the function the ID you’re trying to get the medium images for.
$medium = wp_get_attachment_image_src($picture->ID, 'medium', false);
$med_url = $medium[0];
$med_width = $medium[1];
$med_height = $medium[2];
There are a lot more things you can find out by analyzing wp-includes/gallery.php.
A picture [of my cat] is worth a thousand words.
I’ve been waiting for WordPress.com to update the administration panel so that I can have galleries. That is the main feature that I’ve been waiting for. Now it’s here, I can finally upload pictures of my cat (and my wife
)
This will also allow simpler embedding of video, audio, et al. I’m glad it’s finally live.
EDIT: There seem to be a few kinks still with this feature — instead of having thumbnails, the site was loading the full images. This is obviously an issue. Until then, you get a thumbnail of my cat in the grass. Read more&hellip