How To Integrate Images Shortcode with TimTumb


Sponsored Links






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.

Images Shortcode with TimThumb - Lucy Pinder Nuts August 2010 Photo

Images Shortcode with TimThumb - Lucy Pinder Nuts August 2010 Photo


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 ;)

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Added Permalinks Shortcode on WordPress

WordPress is: Themes, Plugins, Widget, Shortcode, PHP and GPL Licensed. Did you know that, beside Widgets, Another useful WordPress API is shortcode, and now I will show you how to added permalinks shortcode into our WordPress site. Why this shortcode … Read More

Enable Shortcode in Widget

There are simple ways to Enable Shortcode in Widget Area. Using WordPress, there are almost unlimited possibilities, one nice featured that you should learn and uses is Shortcode. With WordPress shortcode, WordPress content writer will be more easier

How To Create a PDF viewer shortcode in WordPress

Did you know, we can create PDF viewer shorcode in WordPress with easy steps? All need to do only using Google Docs viewer tools and integrated it into our WordPress site. The first thing we should do, is written shortcode … Read More

How To Use WordPress shortcode in theme files

Our recent client need some plugin that display the code using shortcode, like we all know, mostly shortcode must be injected or put on post content. Sometime we have another problem, we need to use the shortcode but not in … Read More

How to Fix readfile Problem on TimThumb

TimThumb is my favorite Auto Generated Thumbnail code ever seen, simple to use and work great in almost server. But there are readfile function problem on some server in TimThumb auto resized imaged on the fly, this script development by … Read More

How To inserting Google Maps into WordPress

Today Tutorial is How To inserting Google Maps into WordPress Posts/Pages without Plugin, we only need to write Google Maps shortcode and we can put our own maps with really easy ways. The first time is write down this code … Read More

How To Integrate Google Font Directory on WordPress Theme

How To Integrate Images Shortcode with TimTumb. Every WordPress Developer has seen that TimTumb is wonderful script, This script is better handle to resize image on the fly read more

Source: http://wptricks.net/how-to-integrate-google-font-directory-on-wordpress-theme/

How To Create a PDF viewer shortcode in WordPress / WordPress

How To Integrate Images Shortcode with TimTumb. Every WordPress Developer has seen that TimTumb is wonderful script, This script is better handle to resize image on the fly read more

Source: http://wptricks.net/how-to-create-a-pdf-viewer-shortcode-in-wordpress/

TimThumb PHP Script Released | Darren Hoyt Dot Com

Unfortunately it enlarges images smaller then the h x I will try to integrate it with my WP and see what can I Archive ยป Auto-image redimensionnement avec shortcode read more

Source: http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/


One Response to How To Integrate Images Shortcode with TimTumb

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>