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

1 Answer 1


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().


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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