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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

 
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.