groups

name language licence
Auto-Resize Images Using TimThumb And WordPress Shortcodes PHP Other
Dropping in Your Own Logo PHP Other
Use More Than One Loop On A Page, Without Printing Duplicate Posts PHP Other
Get Posts With A Specific Custom Field And Specific Value PHP Other
Create A Loop Of Images PHP Other
Using Multiple Loops PHP Other

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 >



language: PHP
licence: Other

Auto-Resize Images Using TimThumb And WordPress Shortcodes

options: view full snippetsend to code collector
//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]
	
(Continues...)