Take the 2-minute tour ×
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?

<?php
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.