language: PHP
licence: Other
Auto-Resize Images Using TimThumb And WordPress Shortcodes
//The first thing to do is create the shortcode. Paste the following code in your functions.php file
function imageresizer( $atts, $content = null ) {
return '<img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10//timthumb/timthumb.php?src='.$content.'&w=590" alt="" />';
}
add_shortcode('img', 'imageresizer');
//Now, you can use the following syntax to add an automatically resized image to your blog post:
[img]http://www.yoursite.com/yourimage.jpg[/img]



library
buttons (3)
wp (93)