Control resizing of uploaded images

Why not set your own image sizes from within your theme in functions.php? add_image_size( ‘some-image-size-name’, 500, 300 ); Then you can call that size you want from your template. <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> Links Add image size: http://codex.wordpress.org/Function_Reference/add_image_size get post thumbnail: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

How to use getimagesize() of image upload?

In this part: getimagesize($path.”https://wordpress.stackexchange.com/”.$_POST[‘name’]); the variable $path is an array. Try to use getimagesize($path[‘path’].”https://wordpress.stackexchange.com/”.$_POST[‘name’]); instead.

Filter causing loss of _wp_attachment_metadata

Given that that is a filter, it should be returning $metadata instead of returning nothing. add_filter( ‘wp_generate_attachment_metadata’, ‘mvt_save_photo_credit’, 10, 2 ); function mvt_save_photo_credit( $metadata, $attachment_id ) { add_post_meta($attachment_id, ‘_mvt_credit’, $metadata[‘image_meta’][‘credit’], true); return $metadata; // <– giving back what we got } I was able to duplicate the issue you describe, and that small change fixed … Read more

How to add “alt” attribute for image during upload at WP front-end?

The alt text is stored in the postmeta database table by WordPress, therefore we have to update the postmeta of the given attachment. The reference is done via the unique attachment ID, and the meta_key we are targeting is the _wp_attachment_image_alt. So, to set the alt text, we can do the following: update_post_meta($attach_id, ‘_wp_attachment_image_alt’, ‘Your … Read more

Uploading flash flipbook to mu wordpress site

Upload your files over FTP to some dedicated location, like wp-content/flashbook/ or wp-content/uploads/flashbook/, and manually include the markup in your page. Presumably, the Flash only runs on one page so this shouldn’t be too cumbersome. Actually embedding Flash isn’t as simple as linking to it, but there is plenty of information on the web. This … Read more