Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to pass bloginfo( 'template_directory' ) in an array

I tried this but not working. How to write it correctly?

get_the_image( array( 'size' => 'full',
              'default_image' => bloginfo( "template_directory" ) .'/img/dflt.png',
              'image_scan' => true,
              'link_to_post' => false ) );

get_the_image is a function from Justin Tadlock plugin

share|improve this question

1 Answer 1

up vote 4 down vote accepted

bloginfo() is using echo, you need a function that returns its value: get_bloginfo().

In this case you could also use just the function get_bloginfo() is using: get_template_directory_uri().

share|improve this answer
Speedy answer, thanks – Dipa Nov 11 '12 at 15:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.