145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says
I know that this syntax works
<img src="<?php echo get_bloginfo('template_directory'); ?>/images/noimage.png" />

But I’m using aq_resize and I want to show a default image, if there is no thumbnail and resize it.
 if( $thumbnail_url == '' ) { $thumbnail_url = get_bloginfo('template_directory').'/images/noimage.png'; }
$image = aq_resize( $thumbnail_url,$imgwidth,$imgheight,true );
echo '<img src="'.$image.'" alt="" />'; 

Can you tell me why it doesn’t work?
It might be a syntax error in the first line because
<img src="<?php $thumbnail_url ?>" />

also doesn’t work.

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Anybody knows why this line doesn’t work? The variable is empty, when echoing.

$thumbnail_url = get_bloginfo('template_directory').'/images/noimage.png';
1871 posts YOU TOUCH IT YOU BUY IT
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+6 more
FRESHFACE says

Hi!

it’s because aqua resizer script can resize only images located in /wp-uploads/ folder. But, there is a magic solution :)) You can use our image resizing script, which is able to resize images located everywhere :)

http://themeforest.net/forums/thread/freshizer-custom-wordpress-image-resizer-with-cache/67082 Also note, tat the get_bloginfo(‘template_directory’) is depracted and you should use get_template_directory_uri();

cheers, freshface

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

oh no. changing every resizing code for the third time in my theme ;) haha thanks for the answer

by
by
by
by
by
by