slaterino — 2012-07-12T19:56:40-04:00 — #1
I'm having a problem which is confusing the hell out of me. I worked out a path, which has a number of variables below, and then tried to echo it out as the source of an image. When I do this the image source is only echoing the first part, i.e. the stylesheet directory, and nothing after, and so the image is not displaying. I've tried echo'ing the $path value and it looks perfect, it's just when I use it as the image source it's only displaying the first part. Why is this?
$path = bloginfo( 'stylesheet_directory' ) . "/libs/timthumb.php?w=140&q=100&src=" . get_post_meta($post->ID, 'image', true);
<img src="<?php echo $path; ?>" class="what-image" />
ralphm — 2012-07-13T01:27:03-04:00 — #2
Probably not the problem, but what happens if you change from double to single quotes?
slaterino — 2012-07-13T08:05:42-04:00 — #3
Hey, thanks for the suggestion. I figured it out though. I needed to use 'get_bloginfo' instead of just 'bloginfo', so with 'get_bloginfo( 'stylesheet_directory' )' it worked perfectly.
mittineague — 2014-09-21T19:15:05-04:00 — #4
This topic is now archived. It is frozen and cannot be changed in any way.