Wordpress - Automatically Resize Images


/ Published in: PHP
Save to your folder(s)

From Web Design Ledger "13 Useful Code Snippets for WordPress Development"


Copy this code and paste it in your HTML
  1. function imageresizer( $atts, $content = null ) {
  2. return '<img src="/timthumb/timthumb.php?src='.$content.'&w=590" alt="" />';
  3. }
  4.  
  5. add_shortcode('img', 'imageresizer');
  6.  
  7.  
  8. // Then add the following syntax to your posts
  9. // [img]http://www.yoursite.com/yourimage.jpg[/img

URL: http://webdesignledger.com/tips/13-useful-code-snippets-for-wordpress-development

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.