Every WordPress Developer has seen that TimTumb is wonderful script, This script is better handle to resize image on the fly and display it what ever size we want and we need. Let’s me show you How To Integrate Images Shortcode with TimTumb. The idea is simple. We will use the power of TimThumb and generated better thumbnail and added in our content using shorcode. We got this tricks from Free WordPress Themes designer.
To began this trikcs, open your functions.php we need to added extra code and functions on it.
// Image resize in content
function timmyimg($atts, $content = null) {
extract(shortcode_atts(array(
'w' => '460',
'h' => '250',
'class' => 'alignnone',
'alt' => ''
), $atts));
return "<img src='". get_bloginfo('template_directory') . "/timthumb.php?src=".$content."&w=".$w."&h=".$h."' alt=".$alt." class='wp-post-img ".$class."' />";
}
add_shortcode('img', 'timmyimg');
After you completed it, Download latest TimThumb script (if you have a problem with TimThumb you can try Tips How To Fix TimThumb) and upload it on your current directory. To use this code is simple. Just write down on your post content like this example
[img w=460 h=200 class=alignleft alt=My Photo]http://mysite.com/photo.jpg[/img]
That’s it, you can use this shortcode what ever you want and how many you like



Pingback: How To Integrate Google Font Directory on WordPress Theme | Jhez3R