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';
1882 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by