145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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';
1864 posts YOU TOUCH IT YOU BUY IT
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Has been a member for 5-6 years
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
+1 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
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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